/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('pvtz', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddCustomLineRequest {
  dnsCategory?: string(name='DnsCategory', description='This parameter is not available. You can ignore it.', example='INTRANET'),
  ipv4s?: [ string ](name='Ipv4s', description='The IPv4 CIDR blocks.

This parameter is required.'),
  lang?: string(name='Lang', description='The language.', example='en'),
  name?: string(name='Name', description='The name of the custom line.

This parameter is required.'),
  shareScope?: string(name='ShareScope', description='This parameter is not available. You can ignore it.', example='GLOBAL'),
}

model AddCustomLineResponseBody = {
  lineId?: string(name='LineId', description='The unique ID of the custom line.', example='1065001'),
  name?: string(name='Name', description='The name of the custom line.'),
  requestId?: string(name='RequestId', description='The request ID.', example='AF7D4DCE-0776-47F2-A9B2-6FB85A87AA60'),
}

model AddCustomLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddCustomLineResponseBody(name='body'),
}

/**
 * @summary Creates a custom line.
 *
 * @param request AddCustomLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddCustomLineResponse
 */
async function addCustomLineWithOptions(request: AddCustomLineRequest, runtime: Util.RuntimeOptions): AddCustomLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dnsCategory)) {
    query['DnsCategory'] = request.dnsCategory;
  }
  if (!Util.isUnset(request.ipv4s)) {
    query['Ipv4s'] = request.ipv4s;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.shareScope)) {
    query['ShareScope'] = request.shareScope;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddCustomLine',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a custom line.
 *
 * @param request AddCustomLineRequest
 * @return AddCustomLineResponse
 */
async function addCustomLine(request: AddCustomLineRequest): AddCustomLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return addCustomLineWithOptions(request, runtime);
}

model AddResolverEndpointRequest {
  ipConfig?: [ 
    {
      azId?: string(name='AzId', description='The ID of the zone to which the vSwitch belongs.

This parameter is required.', example='cn-hangzhou-a'),
      cidrBlock?: string(name='CidrBlock', description='The IPv4 CIDR block of the vSwitch.

This parameter is required.', example='172.16.0.0/24'),
      ip?: string(name='Ip', description='The source IP address of outbound traffic. The IP address must be within the specified CIDR block. If you leave this parameter empty, the system automatically allocates an IP address.', example='172.16.xx.xx'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.

This parameter is required.', example='sjqkql'),
    }
  ](name='IpConfig', description='The source IP addresses of outbound traffic. You must add two to six source IP addresses.

>  You must add at least two source IP addresses for outbound traffic to ensure high availability. We recommend that you add two IP addresses that reside in different zones. You can add up to six source IP addresses.

This parameter is required.'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  name?: string(name='Name', description='The endpoint name. The name can be up to 20 characters in length. If the upper limit is exceeded, an error message is returned.

This parameter is required.', example='endpoint-test-name'),
  securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group. The security group rules are applied to the outbound VPC.

>  After you create the outbound endpoint, you cannot change the value of SecurityGroupId. This prevents the forwarding of DNS requests from being interrupted due to misoperations.

This parameter is required.', example='kqlqlqjqqkq'),
  vpcId?: string(name='VpcId', description='The outbound VPC ID. All outbound Domain Name System (DNS) requests of the resolver are forwarded by this VPC.

>  After you create the outbound endpoint, you cannot change the value of VpcId. This prevents the forwarding of DNS requests from being interrupted due to misoperations.

This parameter is required.', example='vpc-129343jslslsks'),
  vpcRegionId?: string(name='VpcRegionId', description='The region ID of the outbound virtual private cloud (VPC).

This parameter is required.', example='cn-hangzhou'),
}

model AddResolverEndpointResponseBody = {
  endpointId?: string(name='EndpointId', description='The endpoint ID.', example='hra0**'),
  requestId?: string(name='RequestId', description='The request ID.', example='32436208-E1AF-4DAB-B3B8-24F5F25B0950'),
}

model AddResolverEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddResolverEndpointResponseBody(name='body'),
}

/**
 * @summary Creates an endpoint.
 *
 * @param request AddResolverEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddResolverEndpointResponse
 */
async function addResolverEndpointWithOptions(request: AddResolverEndpointRequest, runtime: Util.RuntimeOptions): AddResolverEndpointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipConfig)) {
    query['IpConfig'] = request.ipConfig;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.securityGroupId)) {
    query['SecurityGroupId'] = request.securityGroupId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.vpcRegionId)) {
    query['VpcRegionId'] = request.vpcRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddResolverEndpoint',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an endpoint.
 *
 * @param request AddResolverEndpointRequest
 * @return AddResolverEndpointResponse
 */
async function addResolverEndpoint(request: AddResolverEndpointRequest): AddResolverEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return addResolverEndpointWithOptions(request, runtime);
}

model AddResolverRuleRequest {
  endpointId?: string(name='EndpointId', description='The outbound endpoint ID. The outbound endpoint is used to forward the DNS requests to the specified destination IP addresses.

This parameter is required.', example='hr****'),
  forwardIp?: [ 
    {
      ip?: string(name='Ip', description='The IP address of the destination server.

>  The following CIDR blocks are reserved by the system: 100.100.2.136 to 100.100.2.138 and 100.100.2.116 to 100.100.2.118. You cannot specify the IP addresses within these CIDR blocks for the external DNS servers.

This parameter is required.', example='172.16.XX.XX'),
      port?: int32(name='Port', description='The port of the destination server.

This parameter is required.', example='8080'),
    }
  ](name='ForwardIp', description='The IP addresses and ports of the external DNS servers. Enter the IP addresses and ports of the destination servers to which the DNS requests are forwarded. You can enter up to **six** IP addresses and ports. Both private and public IP addresses are supported.

>  If you specify public IP addresses as the IP addresses of the external DNS servers and Elastic Compute Service (ECS) instances in the outbound VPC are not assigned public IP addresses, you need to activate NAT Gateway for the VPC and create and manage SNAT entries on a NAT gateway.

This parameter is required.'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  name?: string(name='Name', description='The name of the forwarding rule. You can name the rule based on your business requirements.

This parameter is required.', example='test'),
  type?: string(name='Type', description='The type of the forwarding rule. The parameter value can only be OUTBOUND, which indicates that DNS requests are forwarded to one or more external IP addresses.

>  You cannot change the value of Type after you create the forwarding rule.', example='OUTBOUND'),
  zoneName?: string(name='ZoneName', description='The zone for which you want to forward DNS requests.

>  You cannot change the value of ZoneName after you create the forwarding rule.

This parameter is required.', example='example.com'),
}

model AddResolverRuleResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='725B8BED-901F-480C-BBAC-FA59A18580C1'),
  ruleId?: string(name='RuleId', description='The ID of the forwarding rule.', example='hr****'),
}

model AddResolverRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddResolverRuleResponseBody(name='body'),
}

/**
 * @summary Creates a forwarding rule.
 *
 * @description #### [](#)**Precautions**
 * If a virtual private cloud (VPC) serves as both an inbound VPC and an outbound VPC, the IP addresses of external Domain Name System (DNS) servers cannot be the same as the IP addresses of the inbound endpoint in the VPC. The IP addresses of the external DNS servers are specified in the forwarding rule associated with the outbound endpoint in the same VPC. If the IP addresses are the same, the DNS requests sent from the IP addresses of the inbound endpoint are returned to the VPC. This results in resolution failures.
 *
 * @param request AddResolverRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddResolverRuleResponse
 */
async function addResolverRuleWithOptions(request: AddResolverRuleRequest, runtime: Util.RuntimeOptions): AddResolverRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.forwardIp)) {
    query['ForwardIp'] = request.forwardIp;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.zoneName)) {
    query['ZoneName'] = request.zoneName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddResolverRule',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a forwarding rule.
 *
 * @description #### [](#)**Precautions**
 * If a virtual private cloud (VPC) serves as both an inbound VPC and an outbound VPC, the IP addresses of external Domain Name System (DNS) servers cannot be the same as the IP addresses of the inbound endpoint in the VPC. The IP addresses of the external DNS servers are specified in the forwarding rule associated with the outbound endpoint in the same VPC. If the IP addresses are the same, the DNS requests sent from the IP addresses of the inbound endpoint are returned to the VPC. This results in resolution failures.
 *
 * @param request AddResolverRuleRequest
 * @return AddResolverRuleResponse
 */
async function addResolverRule(request: AddResolverRuleRequest): AddResolverRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return addResolverRuleWithOptions(request, runtime);
}

model AddUserVpcAuthorizationRequest {
  authChannel?: string(name='AuthChannel', description='The authorization channel. Valid values:

*   AUTH_CODE: A verification code is used for authorization.
*   RESOURCE_DIRECTORY: A resource directory is used for authorization.

Default value: AUTH_CODE.', example='AUTH_CODE'),
  authCode?: string(name='AuthCode', description='The verification code.

> 

*   The specified authentication code is used if the value of AuthChannel is left empty or is set to AUTH_CODE.

*   In other cases, a random 6-digit number is used. Example: 123456.', example='123456'),
  authType?: string(name='AuthType', description='The authorization scope. Valid values:

*   NORMAL: general authorization
*   CLOUD_PRODUCT: cloud service-related authorization', example='NORMAL'),
  authorizedUserId?: long(name='AuthorizedUserId', description='The ID of the Alibaba Cloud account to which the permissions on the resources are granted.

>  You can set an effective scope across accounts only by using an Alibaba Cloud account instead of a RAM user. You can set an effective scope across accounts registered on the same site. For example, you can perform the operation across accounts that are both registered on the Alibaba Cloud China site or Alibaba Cloud international site. You cannot set an effective scope across accounts registered on different sites. For example, you cannot perform the operation across accounts that are separately registered on the Alibaba Cloud China site and Alibaba Cloud international site.

This parameter is required.', example='141339776561****'),
}

model AddUserVpcAuthorizationResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='46973D4C-E3E4-4ABA-9190-9A9DE406C7E'),
}

model AddUserVpcAuthorizationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddUserVpcAuthorizationResponseBody(name='body'),
}

/**
 * @summary Adds another account to associate one or more virtual private clouds (VPCs) of the current account with a private zone.
 *
 * @description #### **Limits**
 * *   You can set an effective scope across accounts only by using an Alibaba Cloud account instead of a RAM user. You can set an effective scope across accounts registered on the same site. For example, you can perform the operation across accounts that are both registered on the Alibaba Cloud China site or Alibaba Cloud international site. You cannot set an effective scope across accounts registered on different sites. For example, you cannot perform the operation across accounts that are separately registered on the Alibaba Cloud China site and Alibaba Cloud international site.
 * *   No API operation is provided for sending the verification codes that are required for authorization.
 * #### **Precautions**
 * If you set an effective scope across accounts, bills are settled within the account that is used to perform routine management on built-in authoritative zones.
 *
 * @param request AddUserVpcAuthorizationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddUserVpcAuthorizationResponse
 */
async function addUserVpcAuthorizationWithOptions(request: AddUserVpcAuthorizationRequest, runtime: Util.RuntimeOptions): AddUserVpcAuthorizationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authChannel)) {
    query['AuthChannel'] = request.authChannel;
  }
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.authType)) {
    query['AuthType'] = request.authType;
  }
  if (!Util.isUnset(request.authorizedUserId)) {
    query['AuthorizedUserId'] = request.authorizedUserId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddUserVpcAuthorization',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds another account to associate one or more virtual private clouds (VPCs) of the current account with a private zone.
 *
 * @description #### **Limits**
 * *   You can set an effective scope across accounts only by using an Alibaba Cloud account instead of a RAM user. You can set an effective scope across accounts registered on the same site. For example, you can perform the operation across accounts that are both registered on the Alibaba Cloud China site or Alibaba Cloud international site. You cannot set an effective scope across accounts registered on different sites. For example, you cannot perform the operation across accounts that are separately registered on the Alibaba Cloud China site and Alibaba Cloud international site.
 * *   No API operation is provided for sending the verification codes that are required for authorization.
 * #### **Precautions**
 * If you set an effective scope across accounts, bills are settled within the account that is used to perform routine management on built-in authoritative zones.
 *
 * @param request AddUserVpcAuthorizationRequest
 * @return AddUserVpcAuthorizationResponse
 */
async function addUserVpcAuthorization(request: AddUserVpcAuthorizationRequest): AddUserVpcAuthorizationResponse {
  var runtime = new Util.RuntimeOptions{};
  return addUserVpcAuthorizationWithOptions(request, runtime);
}

model AddZoneRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='21079fa016944979537637959d09bc'),
  dnsGroup?: string(name='DnsGroup', description='The logical location type of the built-in authoritative module in which the zone is added. Valid values:

*   **NORMAL_ZONE**: the regular module. DNS results are stored in the cache module and DNS requests are sent to the regular module if the DNS requests do not match the DNS records in the cache module. DNS record updates take effect based on the time to live (TTL) value. The regular module does not support DNS resolution over user-defined lines or based on weight values.
*   **FAST_ZONE**: the acceleration module. It directly responds to DNS requests with the lowest latency and updates DNS records in real time. The acceleration module supports DNS resolution over user-defined lines or based on weight values.

Default value: **NORMAL_ZONE**.

>  The DNS results returned by the built-in authoritative acceleration module are not stored in the cache module because the built-in authoritative acceleration module is located before the cache module. As a result, you are charged more for DNS requests.', example='FAST_ZONE'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   **zh**: Chinese
*   **en**: English

Default value: **en**.', example='en'),
  proxyPattern?: string(name='ProxyPattern', description='Specifies whether to enable the recursive resolution proxy for subdomain names. Valid values:

*   **ZONE**: disables the recursive resolution proxy for subdomain names. In this case, NXDOMAIN is returned if the queried subdomain name does not exist in the zone.
*   **RECORD**: enables the recursive resolution proxy for subdomain names. In this case, if the queried subdomain name does not exist in the zone, DNS requests are recursively forwarded to the forward module and then to the recursion module until DNS results are returned.

Default value: **ZONE**.', example='ZONE'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-acfmykd63gt****'),
  zoneName?: string(name='ZoneName', description='The name of the zone to be added.', example='example.com'),
  zoneTag?: string(name='ZoneTag', description='This parameter is not available. You can ignore it.', example='BLINK'),
  zoneType?: string(name='ZoneType', description='This parameter is not available. You can ignore it.', example='CLOUD_PRODUCT_ZONE'),
}

model AddZoneResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='46973D4C-E3E4-4ABA-9190-9A9DE406C7E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.', example='6fc186295683a131f63bb8b0cddc****'),
  zoneName?: string(name='ZoneName', description='The name of the zone.', example='example.com'),
}

model AddZoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddZoneResponseBody(name='body'),
}

/**
 * @summary Creates a built-in authoritative zone in the regular module or acceleration module.
 *
 * @param request AddZoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddZoneResponse
 */
async function addZoneWithOptions(request: AddZoneRequest, runtime: Util.RuntimeOptions): AddZoneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dnsGroup)) {
    query['DnsGroup'] = request.dnsGroup;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.proxyPattern)) {
    query['ProxyPattern'] = request.proxyPattern;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.zoneName)) {
    query['ZoneName'] = request.zoneName;
  }
  if (!Util.isUnset(request.zoneTag)) {
    query['ZoneTag'] = request.zoneTag;
  }
  if (!Util.isUnset(request.zoneType)) {
    query['ZoneType'] = request.zoneType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddZone',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a built-in authoritative zone in the regular module or acceleration module.
 *
 * @param request AddZoneRequest
 * @return AddZoneResponse
 */
async function addZone(request: AddZoneRequest): AddZoneResponse {
  var runtime = new Util.RuntimeOptions{};
  return addZoneWithOptions(request, runtime);
}

model AddZoneRecordRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='6447728c8578e66aacf062d2df4446dc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  line?: string(name='Line', description='The DNS request source. Valid values:

*   default: the default resolution line. The default line is equivalent to a global line. We recommend that you configure a default line to ensure that a DNS record can be returned if no intelligent line is matched.
*   Alibaba Cloud lines: indicate that DNS requests are originated from Alibaba Cloud, including Alibaba Cloud public cloud, Alibaba Finance Cloud, and Alibaba Gov Cloud.
*   Custom lines: You can configure custom lines so that Private DNS can return specific IP addresses for DNS requests that are originated from a specific CIDR block.

> 

*   Only built-in authoritative acceleration zones support custom lines.

*   Set Line to default if you want to choose the default line. Set Line to a specific line code if you want to choose an Alibaba Cloud line or a custom line. Example: aliyun_r_cn-beijing-a.', example='default'),
  priority?: int32(name='Priority', description='The priority of the mail exchanger (MX) record. Valid values: **1 to 99**. A smaller value indicates a higher priority.', example='5'),
  remark?: string(name='Remark', description='The description of the DNS record.', example='en'),
  rr?: string(name='Rr', description='The hostname. The hostname is the prefix of the subdomain name for the zone. Example: www, @, \\\\* (used for wildcard DNS resolution), and mail (used for specifying the mail server that receives emails).

For example, if you want to resolve the domain name @.exmaple.com, you must set Rr to @ instead of leaving Rr empty.

This parameter is required.', example='www'),
  ttl?: int32(name='Ttl', description='The time to live (TTL) period. Valid values: 5, 30, 60, 3600, 43200, and 86400. Unit: seconds. Default value: 60.', example='60'),
  type?: string(name='Type', description='The type of the DNS record. Valid values:

*   **A**: An A record maps a domain name to an IPv4 address in the dotted decimal notation format.
*   **AAAA**: An AAAA record maps a domain name to an IPv6 address.
*   **CNAME**: A canonical name (CNAME) record maps a domain name to another domain name.
*   **TXT**: A text (TXT) record usually serves as a Sender Policy Framework (SPF) record to prevent email spam. The record value of the TXT record can be up to 255 characters in length.
*   **MX**: A mail exchanger (MX) record maps a domain name to the domain name of a mail server.
*   **PTR**: A pointer (PTR) record maps an IP address to a domain name.
*   **SRV**: A service (SRV) record specifies a server that hosts a specific service. Enter a record value in the format of Priority Weight Port Destination domain name. Separate these items with spaces.

>  Before you add a PTR record, you must configure a reverse lookup zone. For more information, see [Add PTR records](https://help.aliyun.com/document_detail/2592976.html).

This parameter is required.', example='A'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
  value?: string(name='Value', description='The record value. You need to enter the record value based on the DNS record type.

This parameter is required.', example='114.55.XX.XX'),
  weight?: int32(name='Weight', description='The weight value of the address. You can set a different weight value for each address. This way, addresses are returned based on the weight values for DNS requests. A weight value must be an integer that ranges from 1 to 100. Default value: 1.', example='1'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.

This parameter is required.', example='df2d03865266bd9842306db586d3****'),
}

model AddZoneRecordResponseBody = {
  recordId?: long(name='RecordId', description='The ID of the DNS record.', example='429570****'),
  requestId?: string(name='RequestId', description='The request ID.', example='0B7AD377-7E86-44A8-B9A8-53E8666E72FE'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model AddZoneRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddZoneRecordResponseBody(name='body'),
}

/**
 * @summary Adds a Domain Name System (DNS) record for a built-in authoritative zone. Within the effective scope, the intranet DNS records rather than the Internet DNS records take effect for the zone.
 *
 * @param request AddZoneRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddZoneRecordResponse
 */
async function addZoneRecordWithOptions(request: AddZoneRecordRequest, runtime: Util.RuntimeOptions): AddZoneRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.line)) {
    query['Line'] = request.line;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.rr)) {
    query['Rr'] = request.rr;
  }
  if (!Util.isUnset(request.ttl)) {
    query['Ttl'] = request.ttl;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  if (!Util.isUnset(request.weight)) {
    query['Weight'] = request.weight;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddZoneRecord',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds a Domain Name System (DNS) record for a built-in authoritative zone. Within the effective scope, the intranet DNS records rather than the Internet DNS records take effect for the zone.
 *
 * @param request AddZoneRecordRequest
 * @return AddZoneRecordResponse
 */
async function addZoneRecord(request: AddZoneRecordRequest): AddZoneRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return addZoneRecordWithOptions(request, runtime);
}

model BindResolverRuleVpcRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  ruleId?: string(name='RuleId', description='The ID of the forwarding rule.

This parameter is required.', example='hr****'),
  vpc?: [ 
    {
      regionId?: string(name='RegionId', description='The region ID of the outbound VPC.', example='cn-hangzhou'),
      vpcId?: string(name='VpcId', description='The VPC ID.', example='vpc-f8zvrvr1payllgz38****'),
      vpcType?: string(name='VpcType', description='The VPC type. Valid values:

*   STANDARD: standard VPC
*   EDS: Elastic Desktop Service (EDS) workspace VPC', example='STANDARD'),
    }
  ](name='Vpc', description='The VPCs that you want to associate with the forwarding rule.'),
}

model BindResolverRuleVpcResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='12FE6E98-3885-423E-B18B-88CC17052A31'),
}

model BindResolverRuleVpcResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindResolverRuleVpcResponseBody(name='body'),
}

/**
 * @summary Associates a forwarding rule with virtual private clouds (VPCs).
 *
 * @param request BindResolverRuleVpcRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindResolverRuleVpcResponse
 */
async function bindResolverRuleVpcWithOptions(request: BindResolverRuleVpcRequest, runtime: Util.RuntimeOptions): BindResolverRuleVpcResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.vpc)) {
    query['Vpc'] = request.vpc;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindResolverRuleVpc',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates a forwarding rule with virtual private clouds (VPCs).
 *
 * @param request BindResolverRuleVpcRequest
 * @return BindResolverRuleVpcResponse
 */
async function bindResolverRuleVpc(request: BindResolverRuleVpcRequest): BindResolverRuleVpcResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindResolverRuleVpcWithOptions(request, runtime);
}

model BindZoneVpcRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='6447728c8578e66aacf062d2df4446dc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
  vpcs?: [ 
    {
      regionId?: string(name='RegionId', description='The region ID of the VPC.', example='cn-beijing'),
      vpcId?: string(name='VpcId', description='The VPC ID. If the zone is already associated with VPCs and you do not specify this parameter, the associated VPCs are disassociated from the zone.', example='vpc-f8zvrvr1payllgz38****'),
      vpcType?: string(name='VpcType', description='The VPC type. Valid values:

*   **STANDARD**: standard VPC
*   **EDS**: Elastic Desktop Service (EDS) workspace VPC', example='STANDARD'),
    }
  ](name='Vpcs', description='The VPCs.

>  If Vpcs is left empty, all VPCs that are associated with the zone are disassociated from the zone.'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.

This parameter is required.', example='34d4031b63c527358b710a61346a****'),
}

model BindZoneVpcResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='46973D4C-E3E4-4ABA-9190-9A9DE406C7E'),
}

model BindZoneVpcResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindZoneVpcResponseBody(name='body'),
}

/**
 * @summary Associates or dissociates virtual private clouds (VPCs) from a zone to set the effective scope of the zone.
 *
 * @description ##### [](#)Precautions:
 * We recommend that you set the effective scope of a zone after you configure all Domain Name System (DNS) records. If you set an effective scope before you configure DNS records, the DNS resolution for the zone within the effective scope will fail unless you enable the recursive resolution proxy for subdomain names.
 *
 * @param request BindZoneVpcRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindZoneVpcResponse
 */
async function bindZoneVpcWithOptions(request: BindZoneVpcRequest, runtime: Util.RuntimeOptions): BindZoneVpcResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.vpcs)) {
    query['Vpcs'] = request.vpcs;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindZoneVpc',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates or dissociates virtual private clouds (VPCs) from a zone to set the effective scope of the zone.
 *
 * @description ##### [](#)Precautions:
 * We recommend that you set the effective scope of a zone after you configure all Domain Name System (DNS) records. If you set an effective scope before you configure DNS records, the DNS resolution for the zone within the effective scope will fail unless you enable the recursive resolution proxy for subdomain names.
 *
 * @param request BindZoneVpcRequest
 * @return BindZoneVpcResponse
 */
async function bindZoneVpc(request: BindZoneVpcRequest): BindZoneVpcResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindZoneVpcWithOptions(request, runtime);
}

model ChangeZoneDnsGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.', example='85456erer657cfgfg3437'),
  dnsGroup?: string(name='DnsGroup', description='The logical location of the built-in authoritative module in which the zone is added. Valid values:

*   Normal zone: regular module
*   Fast Zone: acceleration module

This parameter is required.', example='NORMAL_ZONE'),
  zoneId?: string(name='ZoneId', description='The global ID of the zone.

This parameter is required.', example='e0cff188756b1d4579b25e54b66cb830'),
}

model ChangeZoneDnsGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='C6F1D541-E7A6-447A-A2B5-9F7A20B2A8FB'),
  zoneId?: string(name='ZoneId', description='The global ID of the zone.', example='e0cff188756b1d4579b25e54b66cb830'),
}

model ChangeZoneDnsGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeZoneDnsGroupResponseBody(name='body'),
}

/**
 * @summary Changes the logical location of a zone.
 *
 * @param request ChangeZoneDnsGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeZoneDnsGroupResponse
 */
async function changeZoneDnsGroupWithOptions(request: ChangeZoneDnsGroupRequest, runtime: Util.RuntimeOptions): ChangeZoneDnsGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dnsGroup)) {
    query['DnsGroup'] = request.dnsGroup;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeZoneDnsGroup',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the logical location of a zone.
 *
 * @param request ChangeZoneDnsGroupRequest
 * @return ChangeZoneDnsGroupResponse
 */
async function changeZoneDnsGroup(request: ChangeZoneDnsGroupRequest): ChangeZoneDnsGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeZoneDnsGroupWithOptions(request, runtime);
}

model CheckZoneNameRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
  zoneName?: string(name='ZoneName', description='The name of the zone. This parameter is required.', example='example.com'),
}

model CheckZoneNameResponseBody = {
  check?: boolean(name='Check', description='Indicates whether the zone name can be added. Valid values:

*   **true**
*   **false**', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='CA29B88F-A571-4123-80D5-768AC2F7F806'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
}

model CheckZoneNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckZoneNameResponseBody(name='body'),
}

/**
 * @summary Checks whether a zone name can be added based on a rule.
 *
 * @param request CheckZoneNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckZoneNameResponse
 */
async function checkZoneNameWithOptions(request: CheckZoneNameRequest, runtime: Util.RuntimeOptions): CheckZoneNameResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.zoneName)) {
    query['ZoneName'] = request.zoneName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckZoneName',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Checks whether a zone name can be added based on a rule.
 *
 * @param request CheckZoneNameRequest
 * @return CheckZoneNameResponse
 */
async function checkZoneName(request: CheckZoneNameRequest): CheckZoneNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkZoneNameWithOptions(request, runtime);
}

model DeleteCustomLineRequest {
  lang?: string(name='Lang', description='The language.', example='en'),
  lineId?: string(name='LineId', description='The unique ID of the custom line.

This parameter is required.', example='1045001'),
}

model DeleteCustomLineResponseBody = {
  lineId?: string(name='LineId', description='The unique ID of the custom line.', example='520002'),
  requestId?: string(name='RequestId', description='The request ID.', example='A73F3BD0-B1A8-42A9-A9B6-689BBABC4891'),
}

model DeleteCustomLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomLineResponseBody(name='body'),
}

/**
 * @summary Deletes a custom line.
 *
 * @param request DeleteCustomLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomLineResponse
 */
async function deleteCustomLineWithOptions(request: DeleteCustomLineRequest, runtime: Util.RuntimeOptions): DeleteCustomLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.lineId)) {
    query['LineId'] = request.lineId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCustomLine',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a custom line.
 *
 * @param request DeleteCustomLineRequest
 * @return DeleteCustomLineResponse
 */
async function deleteCustomLine(request: DeleteCustomLineRequest): DeleteCustomLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCustomLineWithOptions(request, runtime);
}

model DeleteResolverEndpointRequest {
  endpointId?: string(name='EndpointId', description='The endpoint ID. This ID uniquely identifies the endpoint.

This parameter is required.', example='hr****'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
}

model DeleteResolverEndpointResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='35134B4A-CEC0-43C8-AAD4-BA54AE3268B5'),
}

model DeleteResolverEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteResolverEndpointResponseBody(name='body'),
}

/**
 * @summary Deletes an endpoint based on the endpoint ID.
 *
 * @param request DeleteResolverEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteResolverEndpointResponse
 */
async function deleteResolverEndpointWithOptions(request: DeleteResolverEndpointRequest, runtime: Util.RuntimeOptions): DeleteResolverEndpointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteResolverEndpoint',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an endpoint based on the endpoint ID.
 *
 * @param request DeleteResolverEndpointRequest
 * @return DeleteResolverEndpointResponse
 */
async function deleteResolverEndpoint(request: DeleteResolverEndpointRequest): DeleteResolverEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteResolverEndpointWithOptions(request, runtime);
}

model DeleteResolverRuleRequest {
  lang?: string(name='Lang', description='The language.', example='en'),
  ruleId?: string(name='RuleId', description='The forwarding rule ID.

This parameter is required.', example='hr****'),
}

model DeleteResolverRuleResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='0C9959BE-3A6A-4803-8DCE-973B42ACD599'),
}

model DeleteResolverRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteResolverRuleResponseBody(name='body'),
}

/**
 * @summary Deletes a forwarding rule based on the rule ID.
 *
 * @param request DeleteResolverRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteResolverRuleResponse
 */
async function deleteResolverRuleWithOptions(request: DeleteResolverRuleRequest, runtime: Util.RuntimeOptions): DeleteResolverRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteResolverRule',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a forwarding rule based on the rule ID.
 *
 * @param request DeleteResolverRuleRequest
 * @return DeleteResolverRuleResponse
 */
async function deleteResolverRule(request: DeleteResolverRuleRequest): DeleteResolverRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteResolverRuleWithOptions(request, runtime);
}

model DeleteUserVpcAuthorizationRequest {
  authType?: string(name='AuthType', description='The authorization scope. Valid values:

*   NORMAL: general authorization
*   NORMAL: cloud service-related authorization

Default value: NORMAL.', example='NORMAL'),
  authorizedUserId?: long(name='AuthorizedUserId', description='The ID of the Alibaba Cloud account.

This parameter is required.', example='141339776561****'),
}

model DeleteUserVpcAuthorizationResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='46973D4C-E3E4-4ABA-9190-9A9DE406C7E'),
}

model DeleteUserVpcAuthorizationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserVpcAuthorizationResponseBody(name='body'),
}

/**
 * @summary Removes an account from the central management of private Domain Name System (DNS) resolution based on the account ID and authorization type.
 *
 * @param request DeleteUserVpcAuthorizationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUserVpcAuthorizationResponse
 */
async function deleteUserVpcAuthorizationWithOptions(request: DeleteUserVpcAuthorizationRequest, runtime: Util.RuntimeOptions): DeleteUserVpcAuthorizationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authType)) {
    query['AuthType'] = request.authType;
  }
  if (!Util.isUnset(request.authorizedUserId)) {
    query['AuthorizedUserId'] = request.authorizedUserId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserVpcAuthorization',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes an account from the central management of private Domain Name System (DNS) resolution based on the account ID and authorization type.
 *
 * @param request DeleteUserVpcAuthorizationRequest
 * @return DeleteUserVpcAuthorizationResponse
 */
async function deleteUserVpcAuthorization(request: DeleteUserVpcAuthorizationRequest): DeleteUserVpcAuthorizationResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserVpcAuthorizationWithOptions(request, runtime);
}

model DeleteZoneRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='21079fa016944979537637959d09bc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.

>  If you want to delete a built-in authoritative zone whose effective scope is configured, you must disassociate the zone from the effective scope first.

This parameter is required.', example='0e41496f12da01311d314f17b801****'),
}

model DeleteZoneResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='E246E023-F2EB-4034-83F7-B13FCF31459C'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.', example='0e41496f12da01311d314f17b801****'),
}

model DeleteZoneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteZoneResponseBody(name='body'),
}

/**
 * @summary Deletes an idle built-in authoritative zone.
 *
 * @description #### [](#)Precautions
 * If you want to delete a built-in authoritative zone whose effective scope is configured, you must disassociate the zone from the effective scope first.
 *
 * @param request DeleteZoneRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteZoneResponse
 */
async function deleteZoneWithOptions(request: DeleteZoneRequest, runtime: Util.RuntimeOptions): DeleteZoneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteZone',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an idle built-in authoritative zone.
 *
 * @description #### [](#)Precautions
 * If you want to delete a built-in authoritative zone whose effective scope is configured, you must disassociate the zone from the effective scope first.
 *
 * @param request DeleteZoneRequest
 * @return DeleteZoneResponse
 */
async function deleteZone(request: DeleteZoneRequest): DeleteZoneResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteZoneWithOptions(request, runtime);
}

model DeleteZoneRecordRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='6447728c8578e66aacf062d2df4446dc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  recordId?: long(name='RecordId', description='The ID of the DNS record.

This parameter is required.', example='306279****'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
}

model DeleteZoneRecordResponseBody = {
  recordId?: long(name='RecordId', description='The ID of the DNS record.', example='306279****'),
  requestId?: string(name='RequestId', description='The request ID.', example='0B7AD377-7E86-44A8-B9A8-53E8666E72FE'),
}

model DeleteZoneRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteZoneRecordResponseBody(name='body'),
}

/**
 * @summary Deletes a Domain Name System (DNS) record based on the ID of the DNS record.
 *
 * @description #### **Precautions**
 * Deleted DNS records cannot be restored. Exercise caution when you perform this operation.
 *
 * @param request DeleteZoneRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteZoneRecordResponse
 */
async function deleteZoneRecordWithOptions(request: DeleteZoneRecordRequest, runtime: Util.RuntimeOptions): DeleteZoneRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteZoneRecord',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a Domain Name System (DNS) record based on the ID of the DNS record.
 *
 * @description #### **Precautions**
 * Deleted DNS records cannot be restored. Exercise caution when you perform this operation.
 *
 * @param request DeleteZoneRecordRequest
 * @return DeleteZoneRecordResponse
 */
async function deleteZoneRecord(request: DeleteZoneRecordRequest): DeleteZoneRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteZoneRecordWithOptions(request, runtime);
}

model DescribeChangeLogsRequest {
  endTimestamp?: long(name='EndTimestamp', description='The end of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1516779348000'),
  entityType?: string(name='EntityType', description='The type of operation logs. Valid values:

*   **PV_ZONE**: the logs that record the operations on built-in authoritative zones
*   **PV_RECORD**: the logs that record the operations on DNS records
*   **RESOLVER_RULE**: the logs that record the operations on forwarding rules
*   **CUSTOM_LINE**: the logs that record the operations on user-defined lines
*   **RESOLVER_ENDPOINT**: the logs that record the operations on outbound endpoints
*   **INBOUND_ENDPOINT**: the logs that record the operations on inbound endpoints
*   **CACHE_RESERVE_DOMAIN**: the logs that record the operations on cache retention domain names

>  If you set EntityType to other values, all types of logs are queried.', example='PV_ZONE'),
  keyword?: string(name='Keyword', description='The keyword of the operation or the operation content. Fuzzy search is supported. The value is not case-sensitive.', example='test'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='100'),
  startTimestamp?: long(name='StartTimestamp', description='The beginning of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1516779348000'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='192.0.XX.XX'),
  zoneId?: string(name='ZoneId', description='The zone ID. Valid values:

*   If you set ZoneId to a zone ID, the logs that record the operations on the DNS records of the specified zone are queried.\\\\

*   If you leave ZoneId empty, the logs that record the operations on all zones and the DNS records of these zones that belong to the current Alibaba Cloud account are queried.', example='df2d03865266bd9842306db586d3****'),
}

model DescribeChangeLogsResponseBody = {
  changeLogs?: {
    changeLog?: [ 
    {
      content?: string(name='Content', description='The operation content.', example='Add RR:test.03 Type:A Line:default TTL:300 Value:172.20.XX.XX'),
      creatorId?: string(name='CreatorId', description='The operator ID.', example='141339776561****'),
      creatorSubType?: string(name='CreatorSubType', description='The subtype of the operator. Valid values:

*   CUSTOMER: Alibaba Cloud account
*   SUB: RAM user
*   STS: assumed role that obtains the Security Token Service (STS) token of a RAM role
*   OTHER: other types', example='SUB'),
      creatorType?: string(name='CreatorType', description='The operator type. No value or **USER** is returned for this parameter.', example='USER'),
      creatorUserId?: string(name='CreatorUserId'),
      entityId?: string(name='EntityId', description='The unique ID of the zone, user-defined line, forwarding rule, outbound endpoint, or inbound endpoint.', example='df2d03865266bd9842306db586d3****'),
      entityName?: string(name='EntityName', description='The name of the object on which the operation was performed, such as the domain name, user-defined line, cache retention domain name, forwarding rule, outbound endpoint, or inbound endpoint.', example='test-api.com'),
      id?: long(name='Id', description='The ID of the operation log.', example='90761578646770****'),
      operAction?: string(name='OperAction', description='The specific operation performed on the object, such as adding, deleting, modifying, or associating the object.', example='add'),
      operIp?: string(name='OperIp', description='The public IP address of the operator terminal. If the IP address of the operator terminal is a private IP address, the value of this parameter is the public IP address to which the private IP address is mapped after network address translation (NAT).', example='192.0.XX.XX'),
      operObject?: string(name='OperObject', description='The type of the object on which the operation was performed. Valid values:

*   **PV_ZONE**: the built-in authoritative zone
*   **PV_RECORD**: the DNS record
*   **RESOLVER_RULE**: the forwarding rule
*   **CUSTOM_LINE**: the user-defined line
*   **RESOLVER_ENDPOINT**: the outbound endpoint
*   **INBOUND_ENDPOINT**: the inbound endpoint
*   **CACHE_RESERVE_DOMAIN**: the cache retention domain name', example='PV_ZONE'),
      operTime?: string(name='OperTime', description='The time when the operation is performed. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2018-01-24T07:35Z'),
      operTimestamp?: long(name='OperTimestamp', description='The time when the operation was performed. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1516779348000'),
    }
  ](name='ChangeLog')
  }(name='ChangeLogs', description='The operation logs.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='2'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='F0FCB52A-D512-41A0-8595-40234EDCFD8B'),
  totalItems?: int32(name='TotalItems', description='The total number of entries returned.', example='100'),
  totalPages?: int32(name='TotalPages', description='The total number of pages returned.', example='100'),
}

model DescribeChangeLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeChangeLogsResponseBody(name='body'),
}

/**
 * @summary Queries the operation logs of Private DNS. Operation logs record operations in modules such as the built-in authoritative module, cache module, forward module, and service address module and record the queries for Domain Name System (DNS) records. You can query operation logs by operation or operation content.
 *
 * @description #### **Precautions**
 * You can query the operation logs of Private DNS that are generated within the last six months.
 *
 * @param request DescribeChangeLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeChangeLogsResponse
 */
async function describeChangeLogsWithOptions(request: DescribeChangeLogsRequest, runtime: Util.RuntimeOptions): DescribeChangeLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTimestamp)) {
    query['EndTimestamp'] = request.endTimestamp;
  }
  if (!Util.isUnset(request.entityType)) {
    query['EntityType'] = request.entityType;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTimestamp)) {
    query['StartTimestamp'] = request.startTimestamp;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeChangeLogs',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the operation logs of Private DNS. Operation logs record operations in modules such as the built-in authoritative module, cache module, forward module, and service address module and record the queries for Domain Name System (DNS) records. You can query operation logs by operation or operation content.
 *
 * @description #### **Precautions**
 * You can query the operation logs of Private DNS that are generated within the last six months.
 *
 * @param request DescribeChangeLogsRequest
 * @return DescribeChangeLogsResponse
 */
async function describeChangeLogs(request: DescribeChangeLogsRequest): DescribeChangeLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeChangeLogsWithOptions(request, runtime);
}

model DescribeCustomLineInfoRequest {
  lang?: string(name='Lang', description='The language of the response.', example='en'),
  lineId?: string(name='LineId', description='The unique ID of the custom line.

This parameter is required.', example='11271'),
}

model DescribeCustomLineInfoResponseBody = {
  createTime?: string(name='CreateTime', description='The time when the custom line was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2018-01-23T03:15Z'),
  createTimestamp?: long(name='CreateTimestamp', description='The time when the custom line was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1516775741000'),
  creator?: string(name='Creator', description='The creator of the custom line.', example='260282302749096109'),
  creatorSubType?: string(name='CreatorSubType', description='The type of the creator. Valid values:

*   CUSTOM: Alibaba Cloud account
*   SUB: RAM user
*   STS: assumed role that obtains the Security Token Service (STS) token of a RAM role
*   OTHER: other roles', example='CUSTOM'),
  creatorType?: string(name='CreatorType', description='The role of the creator. Valid values:

*   USER: user
*   SYSTEM: system', example='USER'),
  ipv4s?: [ string ](name='Ipv4s', description='The IPv4 CIDR blocks.'),
  lineId?: string(name='LineId', description='The unique ID of the custom line.', example='100003'),
  name?: string(name='Name', description='The name of the custom line.'),
  requestId?: string(name='RequestId', description='The request ID.', example='0B7AD377-7E86-44A8-B9A8-53E8666E72FE'),
  updateTime?: string(name='UpdateTime', description='The time when the custom line was updated. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2018-01-24T06:35Z'),
  updateTimestamp?: long(name='UpdateTimestamp', description='The time when the custom line was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1516775741000'),
}

model DescribeCustomLineInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomLineInfoResponseBody(name='body'),
}

/**
 * @summary Queries the information about a custom line.
 *
 * @param request DescribeCustomLineInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomLineInfoResponse
 */
async function describeCustomLineInfoWithOptions(request: DescribeCustomLineInfoRequest, runtime: Util.RuntimeOptions): DescribeCustomLineInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.lineId)) {
    query['LineId'] = request.lineId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomLineInfo',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a custom line.
 *
 * @param request DescribeCustomLineInfoRequest
 * @return DescribeCustomLineInfoResponse
 */
async function describeCustomLineInfo(request: DescribeCustomLineInfoRequest): DescribeCustomLineInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomLineInfoWithOptions(request, runtime);
}

model DescribeCustomLinesRequest {
  lang?: string(name='Lang', description='The language.', example='en'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **1 to 100**. Default value: **10**.', example='10'),
}

model DescribeCustomLinesResponseBody = {
  customLines?: {
    customLine?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the custom line was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2022-03-25T08:07Z'),
      createTimestamp?: long(name='CreateTimestamp', description='The time when the custom line was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1671174074000'),
      creator?: string(name='Creator', description='The creator of the custom line.', example='21312421'),
      creatorSubType?: string(name='CreatorSubType', description='The type of the creator for the custom line. Valid values:

*   CUSTOM: Alibaba Cloud account
*   SUB: RAM user
*   STS: assumed role that obtains the Security Token Service (STS) token of a RAM role
*   OTHER: other roles', example='SUB'),
      creatorType?: string(name='CreatorType', description='The role of the creator for the custom line. Valid values:

*   USER: user
*   SYSTEM: system', example='USER'),
      ipv4s?: {
        ipv4?: [ string ](name='Ipv4')
      }(name='Ipv4s', description='The IPv4 CIDR blocks.'),
      lineId?: string(name='LineId', description='The unique ID of the custom line.', example='160002'),
      name?: string(name='Name', description='The name of the custom line.'),
      updateTime?: string(name='UpdateTime', description='The time when the custom line was updated. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2020-08-24T16:08Z'),
      updateTimestamp?: long(name='UpdateTimestamp', description='The time when the custom line was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1681879029000'),
    }
  ](name='CustomLine')
  }(name='CustomLines', description='The custom lines.'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page **1**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **1 to 100**. Default value: **10**.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='AF7D4DCE-0776-47F2-A9B2-6FB85A87AA60'),
  totalItems?: int32(name='TotalItems', description='The total number of entries returned.', example='100'),
  totalPages?: int32(name='TotalPages', description='The total number of returned pages.', example='5'),
}

model DescribeCustomLinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomLinesResponseBody(name='body'),
}

/**
 * @summary Queries a list of custom lines.
 *
 * @param request DescribeCustomLinesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomLinesResponse
 */
async function describeCustomLinesWithOptions(request: DescribeCustomLinesRequest, runtime: Util.RuntimeOptions): DescribeCustomLinesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomLines',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of custom lines.
 *
 * @param request DescribeCustomLinesRequest
 * @return DescribeCustomLinesResponse
 */
async function describeCustomLines(request: DescribeCustomLinesRequest): DescribeCustomLinesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomLinesWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The supported language. Valid values:

*   zh-CN: Chinese
*   en-US: English

Default value: en-US.

>  AcceptLanguage has a higher priority than Lang.', example='en-US'),
  authorizedUserId?: long(name='AuthorizedUserId', description='The ID of the Alibaba Cloud account to which the permissions on the resources are granted.', example='141339776561****'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   **zh**: Chinese
*   **en**: English

Default value: **en**.

>  Lang has a lower priority than AcceptLanguage.', example='en'),
  scene?: string(name='Scene', description='The scenario. Valid values:

*   AUTH: the built-in authoritative module
*   FWD: the forward module
*   RA: the traffic analysis module', example='AUTH'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='192.168.XX.XX'),
  vpcType?: string(name='VpcType', description='The VPC type. Valid values:

*   STANDARD: standard VPC
*   EDS: Elastic Desktop Service (EDS) workspace VPC', example='STANDARD'),
}

model DescribeRegionsResponseBody = {
  regions?: {
    region?: [ 
    {
      localName?: string(name='LocalName', description='The display name of the region, which varies based on the current language.', example='China (Beijing)'),
      regionEndpoint?: string(name='RegionEndpoint', description='The endpoint of the service in the region.', example='pvtz.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
      regionName?: string(name='RegionName', description='The region name.', example='China (Beijing)'),
    }
  ](name='Region')
  }(name='Regions', description='The regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='AF7D4DCE-0776-47F2-A9B2-6FB85A87AA60'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries a list of regions for selection based on the scenario and virtual private cloud (VPC) type.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.authorizedUserId)) {
    query['AuthorizedUserId'] = request.authorizedUserId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.scene)) {
    query['Scene'] = request.scene;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.vpcType)) {
    query['VpcType'] = request.vpcType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of regions for selection based on the scenario and virtual private cloud (VPC) type.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeRequestGraphRequest {
  bizId?: string(name='BizId', description='The business ID. BizId is specified together with BizType.

*   If you set BizType to AUTH_ZONE, set BizId to a zone ID.
*   If you set BizType to RESOLVER_RULE, set BizId to the ID of a forwarding rule.', example='b9c93a8954c4098731e863c04302f45a'),
  bizType?: string(name='BizType', description='The business type. Valid values:

*   AUTH_ZONE: authoritative zone
*   RESOLVER_RULE: forwarding rule', example='AUTH_ZONE'),
  endTimestamp?: long(name='EndTimestamp', description='The end of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1571673600000'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  startTimestamp?: long(name='StartTimestamp', description='The beginning of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1571587200000'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='192.168.XX.XX'),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC).', example='vpc-f8zvrvr1payllgz38****'),
  zoneId?: string(name='ZoneId', description='The zone ID.

>  To query the number of DNS requests for a zone, you can specify ZoneId or BizType and BizId.', example='29c752a01cd281a20ddcfa****'),
}

model DescribeRequestGraphResponseBody = {
  requestDetails?: {
    zoneRequestTop?: [ 
    {
      requestCount?: long(name='RequestCount', description='The number of DNS requests.', example='103'),
      time?: string(name='Time', description='The time when the data was collected. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2019-10-21T10:00Z'),
      timestamp?: long(name='Timestamp', description='The time when the data was collected. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1571652000000'),
    }
  ](name='ZoneRequestTop')
  }(name='RequestDetails', description='The details of the DNS requests.'),
  requestId?: string(name='RequestId', description='The request ID.', example='EB71815-A421-4E51-8E8D-667F44ABE633'),
}

model DescribeRequestGraphResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRequestGraphResponseBody(name='body'),
}

/**
 * @summary Queries the information about Domain Name System (DNS) requests based on conditions such as the time range.
 *
 * @param request DescribeRequestGraphRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRequestGraphResponse
 */
async function describeRequestGraphWithOptions(request: DescribeRequestGraphRequest, runtime: Util.RuntimeOptions): DescribeRequestGraphResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!Util.isUnset(request.endTimestamp)) {
    query['EndTimestamp'] = request.endTimestamp;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.startTimestamp)) {
    query['StartTimestamp'] = request.startTimestamp;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRequestGraph',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about Domain Name System (DNS) requests based on conditions such as the time range.
 *
 * @param request DescribeRequestGraphRequest
 * @return DescribeRequestGraphResponse
 */
async function describeRequestGraph(request: DescribeRequestGraphRequest): DescribeRequestGraphResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRequestGraphWithOptions(request, runtime);
}

model DescribeResolverAvailableZonesRequest {
  azId?: string(name='AzId', description='The zone ID.', example='cn-zhangjiakou-a'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  resolverRegionId?: string(name='ResolverRegionId', description='The region ID.

This parameter is required.', example='cn-zhangjiakou'),
}

model DescribeResolverAvailableZonesResponseBody = {
  availableZones?: [ 
    {
      azId?: string(name='AzId', description='The zone ID.', example='cn-zhangjiakou-a'),
      status?: string(name='Status', description='The state of resources in the zone. Valid values:

*   NORMAL: The resources are in the normal state.
*   SOLD_OUT: The resources are sold out.', example='NORMAL'),
    }
  ](name='AvailableZones', description='The queried zones.'),
  requestId?: string(name='RequestId', description='The request ID.', example='23268E49-0C3E-4A2C-AB70-B4C7D092470B'),
}

model DescribeResolverAvailableZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResolverAvailableZonesResponseBody(name='body'),
}

/**
 * @summary Queries a list of available zones.
 *
 * @param request DescribeResolverAvailableZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeResolverAvailableZonesResponse
 */
async function describeResolverAvailableZonesWithOptions(request: DescribeResolverAvailableZonesRequest, runtime: Util.RuntimeOptions): DescribeResolverAvailableZonesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.azId)) {
    query['AzId'] = request.azId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resolverRegionId)) {
    query['ResolverRegionId'] = request.resolverRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResolverAvailableZones',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of available zones.
 *
 * @param request DescribeResolverAvailableZonesRequest
 * @return DescribeResolverAvailableZonesResponse
 */
async function describeResolverAvailableZones(request: DescribeResolverAvailableZonesRequest): DescribeResolverAvailableZonesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResolverAvailableZonesWithOptions(request, runtime);
}

model DescribeResolverEndpointRequest {
  endpointId?: string(name='EndpointId', description='The endpoint ID. This ID uniquely identifies the endpoint.

This parameter is required.', example='hr****'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
}

model DescribeResolverEndpointResponseBody = {
  createTime?: string(name='CreateTime', description='The time when the endpoint was created.', example='2020-07-13 10:45:56'),
  createTimestamp?: long(name='CreateTimestamp', description='The time when the endpoint was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1594608356000'),
  id?: string(name='Id', description='The endpoint ID. This ID uniquely identifies the endpoint.', example='hr****'),
  ipConfigs?: [ 
    {
      azId?: string(name='AzId', description='The ID of the zone to which the vSwitch belongs.', example='cn-hangzhou-a'),
      cidrBlock?: string(name='CidrBlock', description='The IPv4 CIDR block of the vSwitch.', example='172.16.XX.XX/24'),
      ip?: string(name='Ip', description='The source IP address of outbound traffic. The IP address must be within the specified CIDR block. If this parameter is left empty, the system automatically allocates an IP address.', example='172.16.XX.XX'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-0jlgeyq4oazkh5xue****'),
    }
  ](name='IpConfigs', description='The configurations of the source IP addresses for outbound traffic.'),
  name?: string(name='Name', description='The name of the endpoint.', example='test'),
  requestId?: string(name='RequestId', description='The request ID.', example='45020ED9-6319-4CA7-9475-6E8D6446E84F'),
  securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group. The security group rules are applied to the outbound virtual private cloud (VPC).', example='sg-8vb3sigz86xc-group-****'),
  status?: string(name='Status', description='The state of the endpoint. Valid values:

*   SUCCESS: The endpoint works as expected.
*   INIT: The endpoint is being created.
*   FAILED: The endpoint failed to be created.
*   CHANGE_INIT: The endpoint is being modified.
*   CHANGE_FAILED: The endpoint failed to be modified.
*   EXCEPTION: The endpoint encountered an exception.', example='SUCCESS'),
  updateTime?: string(name='UpdateTime', description='The time when the endpoint was updated.', example='2020-07-13 10:48:39'),
  updateTimestamp?: long(name='UpdateTimestamp', description='The time when the endpoint was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1594608519000'),
  vpcId?: string(name='VpcId', description='The ID of the outbound VPC. All outbound Domain Name System (DNS) requests of the resolver are forwarded by this VPC.', example='vpc-0jl96awrjt75ezglc****'),
  vpcName?: string(name='VpcName', description='The name of the outbound VPC.', example='vpc-name-test'),
  vpcRegionId?: string(name='VpcRegionId', description='The region ID of the outbound VPC.', example='cn-hangzhou'),
  vpcRegionName?: string(name='VpcRegionName', description='The name of the region where the outbound VPC resides.', example='HuaBei'),
}

model DescribeResolverEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResolverEndpointResponseBody(name='body'),
}

/**
 * @summary Queries the information about an endpoint based on the endpoint ID.
 *
 * @param request DescribeResolverEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeResolverEndpointResponse
 */
async function describeResolverEndpointWithOptions(request: DescribeResolverEndpointRequest, runtime: Util.RuntimeOptions): DescribeResolverEndpointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResolverEndpoint',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an endpoint based on the endpoint ID.
 *
 * @param request DescribeResolverEndpointRequest
 * @return DescribeResolverEndpointResponse
 */
async function describeResolverEndpoint(request: DescribeResolverEndpointRequest): DescribeResolverEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResolverEndpointWithOptions(request, runtime);
}

model DescribeResolverEndpointsRequest {
  keyword?: string(name='Keyword', description='The keyword of the endpoint name, which is used for fuzzy searches.', example='test'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
  status?: string(name='Status', description='The state of the endpoint that you want to query. Valid values:

*   SUCCESS: The endpoint works as expected.
*   INIT: The endpoint is being created.
*   FAILED: The endpoint failed to be created.
*   CHANGE_INIT: The endpoint is being modified.
*   CHANGE_FAILED: The endpoint failed to be modified.
*   EXCEPTION: The endpoint encountered an exception.

>  If you do not specify this parameter, endpoints in all states are returned.', example='SUCCESS'),
  vpcRegionId?: string(name='VpcRegionId', description='The region ID of the outbound virtual private cloud (VPC).', example='cn-zhangjiakou'),
}

model DescribeResolverEndpointsResponseBody = {
  endpoints?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the endpoint was created.', example='2020-07-13 10:36:26'),
      createTimestamp?: long(name='CreateTimestamp', description='The time when the endpoint was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1594607786000'),
      id?: string(name='Id', description='The endpoint ID.', example='hr****'),
      ipConfigs?: [ 
        {
          azId?: string(name='AzId', description='The ID of the zone to which the vSwitch belongs.', example='cn-zhangjiakou-a'),
          cidrBlock?: string(name='CidrBlock', description='The IPv4 CIDR block of the vSwitch.', example='172.16.XX.XX/24'),
          ip?: string(name='Ip', description='The source IP address of outbound traffic. The IP address must be within the specified CIDR block.', example='172.16.XX.XX'),
          vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-0jlgeyq4oazkh5xue****'),
        }
      ](name='IpConfigs', description='The source IP addresses of outbound traffic.'),
      name?: string(name='Name', description='The name of the endpoint.', example='endpoint-test'),
      securityGroupId?: string(name='SecurityGroupId', description='The ID of the security group.', example='sg-0jld3m9yq7l2cw12****'),
      status?: string(name='Status', description='The state of the endpoint that you queried. Valid values:

*   SUCCESS: The endpoint works as expected.
*   INIT: The endpoint is being created.
*   FAILED: The endpoint failed to be created.
*   CHANGE_INIT: The endpoint is being modified.
*   CHANGE_FAILED: The endpoint failed to be modified.
*   EXCEPTION: The endpoint encountered an exception.', example='SUCCESS'),
      updateTime?: string(name='UpdateTime', description='The time when the endpoint was updated.', example='2020-07-13 10:38:24'),
      updateTimestamp?: long(name='UpdateTimestamp', description='The time when the endpoint was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1594607904000'),
      vpcId?: string(name='VpcId', description='The ID of the outbound VPC. All outbound Domain Name System (DNS) requests of the resolver are forwarded by this VPC.', example='vpc-0jlxhpfnj5bfu0bsd****'),
      vpcName?: string(name='VpcName', description='The name of the outbound VPC.', example='vpc-test-name'),
      vpcRegionId?: string(name='VpcRegionId', description='The region ID of the outbound VPC.', example='cn-zhangjiakou'),
      vpcRegionName?: string(name='VpcRegionName', description='The name of the region where the VPC resides.', example='China East 1 (Hangzhou)'),
    }
  ](name='Endpoints', description='The endpoints.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='2'),
  requestId?: string(name='RequestId', description='The request ID.', example='83D1682B-B69A-4060-9FA8-2907C2A35600'),
  totalItems?: int32(name='TotalItems', description='The total number of endpoints.', example='1'),
  totalPages?: int32(name='TotalPages', description='The total number of pages returned.', example='1'),
}

model DescribeResolverEndpointsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResolverEndpointsResponseBody(name='body'),
}

/**
 * @summary Queries a list of endpoints.
 *
 * @param request DescribeResolverEndpointsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeResolverEndpointsResponse
 */
async function describeResolverEndpointsWithOptions(request: DescribeResolverEndpointsRequest, runtime: Util.RuntimeOptions): DescribeResolverEndpointsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.vpcRegionId)) {
    query['VpcRegionId'] = request.vpcRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResolverEndpoints',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of endpoints.
 *
 * @param request DescribeResolverEndpointsRequest
 * @return DescribeResolverEndpointsResponse
 */
async function describeResolverEndpoints(request: DescribeResolverEndpointsRequest): DescribeResolverEndpointsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResolverEndpointsWithOptions(request, runtime);
}

model DescribeResolverRuleRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  ruleId?: string(name='RuleId', description='The ID of the forwarding rule.

This parameter is required.', example='hr****'),
}

model DescribeResolverRuleResponseBody = {
  bindVpcs?: [ 
    {
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      regionName?: string(name='RegionName', description='The region name.', example='hangzhou'),
      vpcId?: string(name='VpcId', description='The VPC ID.', example='vpc-f8zvrvr1payllgz38****'),
      vpcName?: string(name='VpcName', description='The VPC name.', example='vpc-name-test'),
      vpcType?: string(name='VpcType', description='The VPC type. Valid values:

*   STANDARD: standard VPC
*   EDS: Elastic Desktop Service (EDS) workspace VPC', example='STANDARD'),
      vpcUserId?: string(name='VpcUserId', description='The ID of the user to which the VPC belongs.', example='32454****'),
    }
  ](name='BindVpcs', description='The virtual private clouds (VPCs) that are associated with the forwarding rule.'),
  createTime?: string(name='CreateTime', description='The time when the forwarding rule was created.', example='2020-07-13 10:51:44'),
  createTimestamp?: long(name='CreateTimestamp', description='The time when the forwarding rule was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1594608704000'),
  endpointId?: string(name='EndpointId', description='The endpoint ID.', example='hr****'),
  endpointName?: string(name='EndpointName', description='The endpoint name.', example='endpoint-test'),
  forwardIps?: [ 
    {
      ip?: string(name='Ip', description='The destination IP address.', example='172.16.XX.XX'),
      port?: int32(name='Port', description='The port number.', example='8080'),
    }
  ](name='ForwardIps', description='The destination IP addresses.'),
  id?: string(name='Id', description='The ID of the forwarding rule.', example='hr****'),
  name?: string(name='Name', description='The name of the forwarding rule.', example='forward rule-test'),
  requestId?: string(name='RequestId', description='The request ID.', example='13D5113B-7E34-407F-A9C1-D96CD2B04277'),
  type?: string(name='Type', description='The type of the forwarding rule. Valid value:

OUTBOUND: outbound forwarding rule. This type of rule forwards Domain Name System (DNS) requests to one or more external IP addresses.', example='OUTBOUND'),
  updateTime?: string(name='UpdateTime', description='The time when the forwarding rule was updated.', example='2020-07-13 10:51:44'),
  updateTimestamp?: long(name='UpdateTimestamp', description='The time when the forwarding rule was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1594608704000'),
  zoneName?: string(name='ZoneName', description='The name of the forward zone.', example='example.com'),
}

model DescribeResolverRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResolverRuleResponseBody(name='body'),
}

/**
 * @summary Queries the information about a forwarding rule based on the ID of the forwarding rule.
 *
 * @param request DescribeResolverRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeResolverRuleResponse
 */
async function describeResolverRuleWithOptions(request: DescribeResolverRuleRequest, runtime: Util.RuntimeOptions): DescribeResolverRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResolverRule',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a forwarding rule based on the ID of the forwarding rule.
 *
 * @param request DescribeResolverRuleRequest
 * @return DescribeResolverRuleResponse
 */
async function describeResolverRule(request: DescribeResolverRuleRequest): DescribeResolverRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResolverRuleWithOptions(request, runtime);
}

model DescribeResolverRulesRequest {
  endpointId?: string(name='EndpointId', description='The outbound endpoint ID.', example='hr****'),
  keyword?: string(name='Keyword', description='The keyword of the forwarding rule name. Fuzzy search is supported. The value is not case-sensitive.', example='test'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  needDetailAttributes?: boolean(name='NeedDetailAttributes', description='Specifies whether to return virtual private clouds (VPCs) associated with the forwarding rule. Valid values:

*   true
*   false

Default value: false.', example='true'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
}

model DescribeResolverRulesResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='A10E03D7-808C-422D-9144-F8586C2E2297'),
  rules?: [ 
    {
      bindVpcs?: [ 
        {
          regionId?: string(name='RegionId', description='The region ID of the VPC.', example='cn-hangzhou'),
          regionName?: string(name='RegionName', description='The name of the region to which the VPC belongs.', example='ap-southeast-1'),
          vpcId?: string(name='VpcId', description='The VPC ID. This ID uniquely identifies the VPC.', example='vpc-0jl96awrjt75ezglc****'),
          vpcName?: string(name='VpcName', description='The VPC name.', example='vpc-name-test'),
          vpcType?: string(name='VpcType', description='The VPC type. Valid values:

*   STANDARD: standard VPC
*   EDS: Elastic Desktop Service (EDS) workspace VPC', example='STANDARD'),
          vpcUserId?: string(name='VpcUserId', description='The user ID to which the VPC belongs.', example='141339776561****'),
        }
      ](name='BindVpcs', description='The VPCs associated with the forwarding rule.'),
      createTime?: string(name='CreateTime', description='The time when the forwarding was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.', example='2020-07-13 10:51:44'),
      createTimestamp?: long(name='CreateTimestamp', description='The time when the forwarding rule was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1594608704000'),
      endpointId?: string(name='EndpointId', description='The endpoint ID.', example='hr****'),
      endpointName?: string(name='EndpointName', description='The endpoint name.', example='endpoint-test'),
      forwardIps?: [ 
        {
          ip?: string(name='Ip', description='The IP address of the destination server.', example='172.16.XX.XX'),
          port?: int32(name='Port', description='The port of the destination server.', example='8080'),
        }
      ](name='ForwardIps', description='The IP addresses and ports of the external DNS servers. Enter the IP addresses and ports of the destination servers to which the DNS requests are forwarded.'),
      id?: string(name='Id', description='The ID of the forwarding rule.', example='hr****'),
      name?: string(name='Name', description='The name of the forwarding rule.', example='forward rule-test'),
      type?: string(name='Type', description='The type of the forwarding rule.

The parameter value can only be OUTBOUND, which indicates that Domain Name System (DNS) requests are forwarded to one or more external IP addresses.', example='OUTBOUND'),
      updateTime?: string(name='UpdateTime', description='The time when the forwarding rule was last modified. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ss format. The time is displayed in UTC.', example='2020-07-13 10:51:44'),
      updateTimestamp?: long(name='UpdateTimestamp', description='The time when the forwarding rule was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1594608704000'),
      zoneName?: string(name='ZoneName', description='The zone for which you want to forward DNS requests.', example='example.com'),
    }
  ](name='Rules', description='The forwarding rules.'),
  totalItems?: int32(name='TotalItems', description='The total number of entries returned.', example='1'),
  totalPages?: int32(name='TotalPages', description='The total number of returned pages.', example='1'),
}

model DescribeResolverRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResolverRulesResponseBody(name='body'),
}

/**
 * @summary Queries a list of forwarding rules.
 *
 * @param request DescribeResolverRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeResolverRulesResponse
 */
async function describeResolverRulesWithOptions(request: DescribeResolverRulesRequest, runtime: Util.RuntimeOptions): DescribeResolverRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.needDetailAttributes)) {
    query['NeedDetailAttributes'] = request.needDetailAttributes;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResolverRules',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of forwarding rules.
 *
 * @param request DescribeResolverRulesRequest
 * @return DescribeResolverRulesResponse
 */
async function describeResolverRules(request: DescribeResolverRulesRequest): DescribeResolverRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResolverRulesWithOptions(request, runtime);
}

model DescribeStatisticSummaryRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
}

model DescribeStatisticSummaryResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A73F3BD0-B1A8-42A9-A9B6-689BBABC4891'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned.', example='2254'),
  vpcRequestTops?: {
    vpcRequestTop?: [ 
    {
      regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
      regionName?: string(name='RegionName', description='The name of the region.', example='华北 2'),
      requestCount?: long(name='RequestCount', description='The number of DNS requests on the previous day.', example='2254'),
      tunnelId?: string(name='TunnelId', description='The tunnel ID.', example='tun-7h33lkqfuhgnyy****'),
      vpcId?: string(name='VpcId', description='The VPC ID.', example='vpc-f8zvrvr1payllgz38****'),
      vpcType?: string(name='VpcType', description='The VPC type. Valid values:

*   STANDARD: standard VPC
*   EDS: Elastic Desktop Service (EDS) workspace VPC', example='STANDARD'),
    }
  ](name='VpcRequestTop')
  }(name='VpcRequestTops', description='The top three VPCs with the largest number of DNS requests.'),
  zoneRequestTops?: {
    zoneRequestTop?: [ 
    {
      bizType?: string(name='BizType', description='The business type. Valid values:

*   AUTH_ZONE: authoritative zone
*   RESOLVER_RULE: forwarding rule
*   INBOUND: inbound endpoint', example='AUTH_ZONE'),
      requestCount?: long(name='RequestCount', description='The number of DNS requests on the previous day.', example='2251'),
      zoneName?: string(name='ZoneName', description='The zone name.', example='test.com'),
    }
  ](name='ZoneRequestTop')
  }(name='ZoneRequestTops', description='The top three zones with the largest number of DNS requests.'),
}

model DescribeStatisticSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeStatisticSummaryResponseBody(name='body'),
}

/**
 * @summary Queries the statistics on Domain Name System (DNS) requests received on the previous day, including the top three zones and virtual private clouds (VPCs) with the largest number of DNS requests.
 *
 * @param request DescribeStatisticSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeStatisticSummaryResponse
 */
async function describeStatisticSummaryWithOptions(request: DescribeStatisticSummaryRequest, runtime: Util.RuntimeOptions): DescribeStatisticSummaryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeStatisticSummary',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics on Domain Name System (DNS) requests received on the previous day, including the top three zones and virtual private clouds (VPCs) with the largest number of DNS requests.
 *
 * @param request DescribeStatisticSummaryRequest
 * @return DescribeStatisticSummaryResponse
 */
async function describeStatisticSummary(request: DescribeStatisticSummaryRequest): DescribeStatisticSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeStatisticSummaryWithOptions(request, runtime);
}

model DescribeSyncEcsHostTaskRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.

This parameter is required.', example='pvtz-test-id-2989149d628c5****'),
}

model DescribeSyncEcsHostTaskResponseBody = {
  ecsRegions?: {
    ecsRegion?: [ 
    {
      regionIds?: {
        regionId?: [ string ](name='RegionId')
      }(name='RegionIds', description='The synchronized region IDs.'),
      userId?: long(name='UserId', description='The user ID to which the region belongs. This parameter is used in cross-account synchronization scenarios.', example='141339776561****'),
    }
  ](name='EcsRegion')
  }(name='EcsRegions', description='The synchronized regions where the ECS instances are deployed.'),
  regions?: {
    regionId?: [ string ](name='RegionId')
  }(name='Regions', description='The synchronized region IDs of the ECS instances.'),
  requestId?: string(name='RequestId', description='The request ID.', example='75446CC1-FC9A-4595-8D96-089D73D7A63D'),
  status?: string(name='Status', description='Indicates whether hostname automatic synchronization is enabled. Valid values:

*   ON: Hostname automatic synchronization is enabled. After this feature is enabled, the system automatically reads the hostnames of the Elastic Compute Service (ECS) instances in the specified regions and updates Domain Name System (DNS) records at an interval of 1 minute.
*   OFF: Hostname automatic synchronization is disabled.', example='ON'),
  success?: boolean(name='Success', description='Indicates whether the task was successful. Valid values:

*   True
*   False', example='True'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.', example='pvtz-test-id-2989149d628c56****'),
}

model DescribeSyncEcsHostTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSyncEcsHostTaskResponseBody(name='body'),
}

/**
 * @summary Queries the information about a hostname synchronization task based on a zone ID.
 *
 * @description You can call the DescribeSyncEcsHostTask operation to query the information about a hostname synchronization task based on a zone ID.
 *
 * @param request DescribeSyncEcsHostTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSyncEcsHostTaskResponse
 */
async function describeSyncEcsHostTaskWithOptions(request: DescribeSyncEcsHostTaskRequest, runtime: Util.RuntimeOptions): DescribeSyncEcsHostTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSyncEcsHostTask',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a hostname synchronization task based on a zone ID.
 *
 * @description You can call the DescribeSyncEcsHostTask operation to query the information about a hostname synchronization task based on a zone ID.
 *
 * @param request DescribeSyncEcsHostTaskRequest
 * @return DescribeSyncEcsHostTaskResponse
 */
async function describeSyncEcsHostTask(request: DescribeSyncEcsHostTaskRequest): DescribeSyncEcsHostTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSyncEcsHostTaskWithOptions(request, runtime);
}

model DescribeTagsRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Maximum number: 1. Default value: 20.', example='20'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid value: ZONE.

This parameter is required.', example='ZONE'),
}

model DescribeTagsResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='20'),
  requestId?: string(name='RequestId', description='The request ID.', example='9EA7F720-B7C0-45C1-9CF4-B6A5A1179B68'),
  tags?: [ 
    {
      key?: string(name='Key', description='The key of tag N added to the resource.', example='env'),
      values?: [ string ](name='Values', description='The values of tags added to the resources.'),
    }
  ](name='Tags', description='The tags added to the resources.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='200'),
}

model DescribeTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTagsResponseBody(name='body'),
}

/**
 * @summary Queries a list of tags added to zones.
 *
 * @description #### **Precautions**
 * You can call this API operation to query the information about tags added only to zones.
 *
 * @param request DescribeTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTagsResponse
 */
async function describeTagsWithOptions(request: DescribeTagsRequest, runtime: Util.RuntimeOptions): DescribeTagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTags',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of tags added to zones.
 *
 * @description #### **Precautions**
 * You can call this API operation to query the information about tags added only to zones.
 *
 * @param request DescribeTagsRequest
 * @return DescribeTagsResponse
 */
async function describeTags(request: DescribeTagsRequest): DescribeTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTagsWithOptions(request, runtime);
}

model DescribeUserServiceStatusRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
}

model DescribeUserServiceStatusResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='99626905-678A-4E8A-984E-6AEB09993996'),
  status?: string(name='Status', description='Current user\\\\"s service status:

*  **CLOSED**: Not activated
*  **OPENED**: Activated
*  **IN_DEBT**: Overdue payment
*  **IN_DEBT_OVER_DUE**: Payment overdue', example='OPENED'),
}

model DescribeUserServiceStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserServiceStatusResponseBody(name='body'),
}

/**
 * @summary Query the current user\\"s service status, such as whether the service is activated, whether there are any unpaid fees, etc.
 *
 * @param request DescribeUserServiceStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserServiceStatusResponse
 */
async function describeUserServiceStatusWithOptions(request: DescribeUserServiceStatusRequest, runtime: Util.RuntimeOptions): DescribeUserServiceStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserServiceStatus',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the current user\\"s service status, such as whether the service is activated, whether there are any unpaid fees, etc.
 *
 * @param request DescribeUserServiceStatusRequest
 * @return DescribeUserServiceStatusResponse
 */
async function describeUserServiceStatus(request: DescribeUserServiceStatusRequest): DescribeUserServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserServiceStatusWithOptions(request, runtime);
}

model DescribeUserVpcAuthorizationsRequest {
  authType?: string(name='AuthType', description='The authorization scope. Valid values:

*   NORMAL: general authorization
*   CLOUD_PRODUCT: cloud service-related authorization', example='NORMAL'),
  authorizedUserId?: long(name='AuthorizedUserId', description='The ID of the Alibaba Cloud account to which the permissions on the resources are granted.', example='141339776561****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='20'),
}

model DescribeUserVpcAuthorizationsResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='20'),
  requestId?: string(name='RequestId', description='The request ID.', example='46973D4C-E3E4-4ABA-9190-9A9DE406C7E'),
  totalItems?: int32(name='TotalItems', description='The total number of entries returned.', example='100'),
  totalPages?: int32(name='TotalPages', description='The total number of returned pages.', example='5'),
  users?: [ 
    {
      authType?: string(name='AuthType', description='The authorization scope. Valid values:

*   NORMAL: general authorization
*   CLOUD_PRODUCT: cloud service-related authorization', example='NORMAL'),
      authorizedAliyunId?: string(name='AuthorizedAliyunId', description='The name of the Alibaba Cloud account to which the permissions on the resources are granted.', example='alidn****@test.com'),
      authorizedUserId?: long(name='AuthorizedUserId', description='The ID of the Alibaba Cloud account to which the permissions on the resources are granted.', example='141339776561****'),
      createTime?: string(name='CreateTime', description='The time when the authorization was performed. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2023-05-08T02:31Z'),
      createTimestamp?: long(name='CreateTimestamp', description='The time when the authorization was performed. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1672740294000'),
    }
  ](name='Users', description='The Alibaba Cloud accounts to which the permissions on the resources are granted.'),
}

model DescribeUserVpcAuthorizationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserVpcAuthorizationsResponseBody(name='body'),
}

/**
 * @summary Queries a list of accounts whose virtual private clouds (VPCs) are associated with a private zone.
 *
 * @param request DescribeUserVpcAuthorizationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserVpcAuthorizationsResponse
 */
async function describeUserVpcAuthorizationsWithOptions(request: DescribeUserVpcAuthorizationsRequest, runtime: Util.RuntimeOptions): DescribeUserVpcAuthorizationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authType)) {
    query['AuthType'] = request.authType;
  }
  if (!Util.isUnset(request.authorizedUserId)) {
    query['AuthorizedUserId'] = request.authorizedUserId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserVpcAuthorizations',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of accounts whose virtual private clouds (VPCs) are associated with a private zone.
 *
 * @param request DescribeUserVpcAuthorizationsRequest
 * @return DescribeUserVpcAuthorizationsResponse
 */
async function describeUserVpcAuthorizations(request: DescribeUserVpcAuthorizationsRequest): DescribeUserVpcAuthorizationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserVpcAuthorizationsWithOptions(request, runtime);
}

model DescribeZoneInfoRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   **zh**: Chinese
*   **en**: English.

Default value: **en**.', example='en'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.

This parameter is required.', example='df2d03865266bd9842306db586d3****'),
}

model DescribeZoneInfoResponseBody = {
  bindVpcs?: {
    vpc?: [ 
    {
      regionId?: string(name='RegionId', description='The region ID of the VPC.', example='cn-heyuan'),
      regionName?: string(name='RegionName', description='The name of the region where the VPC resides.', example='China (Heyuan)'),
      vpcId?: string(name='VpcId', description='The VPC ID. This ID uniquely identifies the VPC.', example='vpc-f8zvrvr1payllgz38****'),
      vpcName?: string(name='VpcName', description='The VPC name.', example='vpc_test'),
      vpcType?: string(name='VpcType', description='The VPC type. Valid values:

*   STANDARD: standard VPC
*   EDS: Elastic Desktop Service (EDS) workspace VPC', example='STANDARD'),
      vpcUserId?: long(name='VpcUserId', description='The user ID to which the VPC belongs. If null is returned, the VPC belongs to the current user.', example='141339776561****'),
    }
  ](name='Vpc')
  }(name='BindVpcs', description='The VPCs associated with the zone.'),
  createTime?: string(name='CreateTime', description='The time when the zone was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2018-01-23T03:15Z'),
  createTimestamp?: long(name='CreateTimestamp', description='The time when the zone was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1516775741000'),
  creator?: string(name='Creator', description='The creator of the zone.', example='141339776561****'),
  creatorType?: string(name='CreatorType', description='The type of the creator.', example='USER'),
  dnsGroup?: string(name='DnsGroup', description='The logical location type of the built-in authoritative module in which the zone is added. Valid values:

*   **NORMAL_ZONE**: regular module
*   **FAST_ZONE**: acceleration module', example='FAST_ZONE'),
  dnsGroupChanging?: boolean(name='DnsGroupChanging', description='Indicates whether the zone is being removed to another logical location. Valid values:

*   true
*   false', example='false'),
  isPtr?: boolean(name='IsPtr', description='Indicates whether the zone is a reverse lookup zone. Valid values:

*   true
*   false', example='false'),
  proxyPattern?: string(name='ProxyPattern', description='Indicates whether the recursive resolution proxy for subdomain names is enabled. Valid values:

*   ZONE: The recursive resolution proxy for subdomain names is disabled. In this case, NXDOMAIN is returned if the queried domain name does not exist in the zone.
*   RECORD: The recursive resolution proxy for subdomain names is enabled. In this case, if the queried domain name does not exist in the zone, DNS requests are recursively forwarded to the forward module and then to the recursion module until DNS results are returned.', example='ZONE'),
  recordCount?: int32(name='RecordCount', description='The total number of DNS records added in the zone.', example='2'),
  remark?: string(name='Remark', description='The description of the zone.', example='test'),
  requestId?: string(name='RequestId', description='The request ID.', example='F73F41A3-B6DD-42CA-A793-FFF93277835D'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the zone belongs.', example='rg-acfmykd63gt****'),
  slaveDns?: boolean(name='SlaveDns', description='Indicates whether the secondary Domain Name System (DNS) feature is enabled for the zone. Valid values:

*   **true**: The secondary DNS feature is enabled.
*   **false**: The secondary DNS feature is disabled.', example='true'),
  updateTime?: string(name='UpdateTime', description='The time when the zone was last updated. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2018-01-24T06:35Z'),
  updateTimestamp?: long(name='UpdateTimestamp', description='The time when the zone was last updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1516775741000'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.', example='df2d03865266bd9842306db586d3****'),
  zoneName?: string(name='ZoneName', description='The zone name.', example='zone-test.cn'),
  zoneTag?: string(name='ZoneTag', description='The tag added to the zone.', example='pvtz'),
  zoneType?: string(name='ZoneType', description='The zone type. Valid values:

*   **AUTH_ZONE**: authoritative zone
*   **CLOUD_PRODUCT_ZONE**: authoritative zone for cloud services', example='CLOUD_PRODUCT_ZONE'),
}

model DescribeZoneInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeZoneInfoResponseBody(name='body'),
}

/**
 * @summary Queries the information about a built-in authoritative zone, such as the virtual private clouds (VPCs) that are associated with the zone.
 *
 * @param request DescribeZoneInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeZoneInfoResponse
 */
async function describeZoneInfoWithOptions(request: DescribeZoneInfoRequest, runtime: Util.RuntimeOptions): DescribeZoneInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeZoneInfo',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a built-in authoritative zone, such as the virtual private clouds (VPCs) that are associated with the zone.
 *
 * @param request DescribeZoneInfoRequest
 * @return DescribeZoneInfoResponse
 */
async function describeZoneInfo(request: DescribeZoneInfoRequest): DescribeZoneInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeZoneInfoWithOptions(request, runtime);
}

model DescribeZoneRecordRequest {
  recordId?: long(name='RecordId', description='The ID of the DNS record.

This parameter is required.', example='5808'),
}

model DescribeZoneRecordResponseBody = {
  createTime?: string(name='CreateTime', description='The time when the DNS record was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2018-01-23T03:15Z'),
  createTimestamp?: long(name='CreateTimestamp', description='The time when the DNS record was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1516775741000'),
  line?: string(name='Line', description='The resolution line.', example='default'),
  priority?: int32(name='Priority', description='The priority of the mail exchanger (MX) record.', example='5'),
  recordId?: long(name='RecordId', description='The ID of the DNS record.', example='5808'),
  remark?: string(name='Remark', description='The description of the DNS record.', example='test record'),
  requestId?: string(name='RequestId', description='The request ID.', example='0B7AD377-7E86-44A8-B9A8-53E8666E72FE'),
  rr?: string(name='Rr', description='The hostname.', example='www'),
  status?: string(name='Status', description='The state of the DNS record. Valid values:

*   **ENABLE**: The DNS record is enabled.
*   **DISABLE**: The DNS record is disabled.', example='ENABLE'),
  ttl?: int32(name='Ttl', description='The time to live (TTL) of the DNS record.', example='60'),
  type?: string(name='Type', description='The type of the DNS record.', example='A'),
  updateTime?: string(name='UpdateTime', description='The time when the DNS record was updated. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2018-01-24T06:35Z'),
  updateTimestamp?: long(name='UpdateTimestamp', description='The time when the DNS record was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1516775741000'),
  value?: string(name='Value', description='The record value.', example='127.0.0.1'),
  weight?: int32(name='Weight', description='The weight value of the DNS record.', example='1'),
  zoneId?: string(name='ZoneId', description='The zone ID.', example='CAgICA1OA_58'),
}

model DescribeZoneRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeZoneRecordResponseBody(name='body'),
}

/**
 * @summary Queries the information about a Domain Name System (DNS) record.
 *
 * @param request DescribeZoneRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeZoneRecordResponse
 */
async function describeZoneRecordWithOptions(request: DescribeZoneRecordRequest, runtime: Util.RuntimeOptions): DescribeZoneRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeZoneRecord',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a Domain Name System (DNS) record.
 *
 * @param request DescribeZoneRecordRequest
 * @return DescribeZoneRecordResponse
 */
async function describeZoneRecord(request: DescribeZoneRecordRequest): DescribeZoneRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeZoneRecordWithOptions(request, runtime);
}

model DescribeZoneRecordsRequest {
  keyword?: string(name='Keyword', description='The keyword of the hostname. The value is not case-sensitive. You can set SearchMode to LIKE or EXACT. The default value of SearchMode is EXACT.', example='test'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: 1 to 100. Default value: 20.', example='100'),
  searchMode?: string(name='SearchMode', description='The search mode. Valid values:

*   **LIKE**: fuzzy search
*   **EXACT** (default): exact search

The value of Keyword is the search scope.', example='LIKE'),
  tag?: string(name='Tag', description='The tag added to the DNS record. Valid values:

*   ecs: If you set Tag to ecs, the DNS records added to the hostnames of Elastic Compute Service (ECS) instances in the zone are queried.
*   If Tag is left empty, the DNS records in the zone are queried.', example='ecs'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.

This parameter is required.', example='a96d70eb4ab8ef01503dc5486914****'),
}

model DescribeZoneRecordsResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='100'),
  records?: {
    record?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the DNS record was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2019-03-14T03:47Z'),
      createTimestamp?: long(name='CreateTimestamp', description='The time when the DNS record was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1672740294000'),
      line?: string(name='Line', description='The resolution line.', example='default'),
      priority?: int32(name='Priority', description='The priority of the mail exchanger (MX) record.', example='10'),
      recordId?: long(name='RecordId', description='The ID of the DNS record.', example='246959****'),
      remark?: string(name='Remark', description='The description of the DNS record.', example='test'),
      rr?: string(name='Rr', description='The hostname.', example='www'),
      status?: string(name='Status', description='The state of the DNS record. Valid values:

*   ENABLE: The DNS record is enabled.
*   DISABLE: The DNS record is disabled.', example='ENABLE'),
      ttl?: int32(name='Ttl', description='The time to live (TTL) period.', example='60'),
      type?: string(name='Type', description='The type of the DNS record. Valid values:

*   **A**: An A record points a domain name to an IPv4 address.
*   **AAAA**: An AAAA record points a domain name to an IPv6 address.
*   **CNAME**: A canonical name (CNAME) record points a domain name to another domain name.
*   **TXT**: A text (TXT) record usually serves as a Sender Policy Framework (SPF) record to prevent email spam. The record value of the TXT record can be up to 255 characters in length.
*   **MX**: A mail exchanger (MX) record points a domain name to a mail server address.
*   **PTR**: A pointer (PTR) points an IP address to a domain name.
*   **SRV**: A service (SRV) record specifies a server that hosts a specific service.', example='A'),
      updateTime?: string(name='UpdateTime', description='The time when the DNS record was updated. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2023-05-08T02:31Z'),
      updateTimestamp?: long(name='UpdateTimestamp', description='The time when the DNS record was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1654777678000'),
      value?: string(name='Value', description='The record value.', example='127.0.XX.XX'),
      weight?: int32(name='Weight', description='The weight value of the address. You can set a different weight value for each address. This way, addresses are returned based on the weight values for DNS requests. A weight value must be an integer that ranges from 1 to 100.', example='1'),
      zoneId?: string(name='ZoneId', description='The zone ID.', example='a49f55537f3b0b1e6e43add0bf5f****'),
    }
  ](name='Record')
  }(name='Records', description='The DNS records.'),
  requestId?: string(name='RequestId', description='The request ID.', example='7B07FBC3-3A53-4939-A3C6-2BDFE407BAB2'),
  totalItems?: int32(name='TotalItems', description='The total number of entries returned.', example='100'),
  totalPages?: int32(name='TotalPages', description='The total number of pages returned.', example='100'),
}

model DescribeZoneRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeZoneRecordsResponseBody(name='body'),
}

/**
 * @summary Queries a list of Domain Name System (DNS) records.
 *
 * @param request DescribeZoneRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeZoneRecordsResponse
 */
async function describeZoneRecordsWithOptions(request: DescribeZoneRecordsRequest, runtime: Util.RuntimeOptions): DescribeZoneRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchMode)) {
    query['SearchMode'] = request.searchMode;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeZoneRecords',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of Domain Name System (DNS) records.
 *
 * @param request DescribeZoneRecordsRequest
 * @return DescribeZoneRecordsResponse
 */
async function describeZoneRecords(request: DescribeZoneRecordsRequest): DescribeZoneRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeZoneRecordsWithOptions(request, runtime);
}

model DescribeZoneVpcTreeRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
}

model DescribeZoneVpcTreeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='7B07FBC3-3A53-4939-A3C6-2BDFE407BAB2'),
  zones?: {
    zone?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the zone was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2019-09-18T08:20Z'),
      createTimestamp?: long(name='CreateTimestamp', description='The time when the zone was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1568794812000'),
      creator?: string(name='Creator', description='The creator of the zone.', example='141339776561****'),
      creatorType?: string(name='CreatorType', description='The operator type.', example='USER'),
      dnsGroup?: string(name='DnsGroup', description='The logical location of the built-in authoritative module in which the zone is added. Valid values:

*   NORMAL_ZONE: regular module
*   FAST_ZONE: acceleration module', example='NORMAL_ZONE'),
      dnsGroupChanging?: boolean(name='DnsGroupChanging', description='Indicates whether the zone is being removed to another logical location. Valid values:

*   true
*   false', example='true'),
      isPtr?: boolean(name='IsPtr', description='Indicates whether the zone is a reverse lookup zone. Valid values:

*   true
*   false', example='false'),
      recordCount?: int32(name='RecordCount', description='The number of Domain Name System (DNS) records added for the zone.', example='1'),
      remark?: string(name='Remark', description='The description of the zone.', example='demo'),
      updateTime?: string(name='UpdateTime', description='The time when the zone was last modified. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2019-09-18T08:20Z'),
      updateTimestamp?: long(name='UpdateTimestamp', description='The time when the zone was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1568794834000'),
      vpcs?: {
        vpc?: [ 
        {
          regionId?: string(name='RegionId', description='The region ID of the VPC.', example='cn-heyuan'),
          regionName?: string(name='RegionName', description='The name of the region to which the VPC belongs.', example='China (Heyuan)'),
          vpcId?: string(name='VpcId', description='The VPC ID. The unique ID of the VPC.', example='vpc-f8zvrvr1payllgz38****'),
          vpcName?: string(name='VpcName', description='The VPC name.', example='demo-vpc'),
          vpcType?: string(name='VpcType', description='The VPC type. Valid values:

*   STANDARD: standard VPC
*   EDS: Elastic Desktop Service (EDS) workspace VPC', example='STANDARD'),
        }
      ](name='Vpc')
      }(name='Vpcs', description='The VPCs associated with the zone.'),
      zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.', example='6d83e3b31aa60ca4aaa7161f1b6baa95'),
      zoneName?: string(name='ZoneName', description='The zone name.', example='example.com'),
      zoneTag?: string(name='ZoneTag', description='The type of the cloud service.


**Valid values:**

*   If ZoneType is set to AUTH_ZONE, no value is returned for this parameter.

*   If ZoneType is set to CLOUD_PRODUCT_ZONE, the type of the cloud service is returned.', example='BLINK'),
      zoneType?: string(name='ZoneType', description='The zone type. Valid values:

*   AUTH_ZONE: authoritative zone
*   CLOUD_PRODUCT_ZONE: authoritative zone for cloud services', example='AUTH_ZONE'),
    }
  ](name='Zone')
  }(name='Zones', description='The zones.'),
}

model DescribeZoneVpcTreeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeZoneVpcTreeResponseBody(name='body'),
}

/**
 * @summary Queries a list of zones within the current account and a list of virtual private clouds (VPCs) associated with the zones.
 *
 * @description We recommend that you do not call this API operation due to its poor performance. Instead, you can call the DescribeZones operation to query a list of zones. If you want to query the information about VPCs with which a zone is associated, you can call the DescribeZoneInfo operation based on the zone ID.
 *
 * @param request DescribeZoneVpcTreeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeZoneVpcTreeResponse
 */
async function describeZoneVpcTreeWithOptions(request: DescribeZoneVpcTreeRequest, runtime: Util.RuntimeOptions): DescribeZoneVpcTreeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeZoneVpcTree',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of zones within the current account and a list of virtual private clouds (VPCs) associated with the zones.
 *
 * @description We recommend that you do not call this API operation due to its poor performance. Instead, you can call the DescribeZones operation to query a list of zones. If you want to query the information about VPCs with which a zone is associated, you can call the DescribeZoneInfo operation based on the zone ID.
 *
 * @param request DescribeZoneVpcTreeRequest
 * @return DescribeZoneVpcTreeResponse
 */
async function describeZoneVpcTree(request: DescribeZoneVpcTreeRequest): DescribeZoneVpcTreeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeZoneVpcTreeWithOptions(request, runtime);
}

model DescribeZonesRequest {
  keyword?: string(name='Keyword', description='The keyword of the zone name. The value is not case-sensitive. You can set SearchMode to LIKE or EXACT. The default value of SearchMode is LIKE.', example='test'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **1 to 100**. Default value: **20**.', example='100'),
  queryRegionId?: string(name='QueryRegionId', description='The region ID of the virtual private cloud (VPC) associated with the zone.', example='cn-hangzhou'),
  queryVpcId?: string(name='QueryVpcId', description='The ID of the VPC associated with the zone.', example='vpc-f8zvrvr1payllgz38****'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the zone belongs.', example='rg-aekz2qj7awz****'),
  resourceTag?: [ 
    {
      key?: string(name='Key', description='The key of tag N added to the zone.', example='env'),
      value?: string(name='Value', description='The value of tag N added to the zone.', example='daily'),
    }
  ](name='ResourceTag', description='The tags added to the zone.'),
  searchMode?: string(name='SearchMode', description='The search mode. The value of Keyword is the search scope. Valid values:

*   **LIKE** (default): fuzzy search
*   **EXACT**: exact search

Default value: **LIKE**.', example='LIKE'),
  zoneTag?: [ string ](name='ZoneTag', description='The types of cloud services.', example='BLINK'),
  zoneType?: string(name='ZoneType', description='The zone type. Valid values:

*   **AUTH_ZONE**: authoritative zone
*   **CLOUD_PRODUCT_ZONE**: authoritative zone for cloud services

Default value: **AUTH_ZONE**.', example='CLOUD_PRODUCT_ZONE'),
}

model DescribeZonesResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='20'),
  requestId?: string(name='RequestId', description='The request ID.', example='6856BCF6-11D6-4D7E-AC53-FD579933522B'),
  totalItems?: int32(name='TotalItems', description='The total number of entries returned.', example='3'),
  totalPages?: int32(name='TotalPages', description='The total number of returned pages.', example='3'),
  zones?: {
    zone?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the zone was created. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2017-12-28T13:08Z'),
      createTimestamp?: long(name='CreateTimestamp', description='The time when the zone was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1514466483000'),
      creator?: string(name='Creator', description='The creator of the zone.', example='546356****'),
      creatorSubType?: string(name='CreatorSubType', description='The account type. Valid values:

*   **CUSTOMER**: Alibaba Cloud account
*   **SUB**: RAM user
*   **STS**: assumed role that obtains the Security Token Service (STS) token of a RAM role
*   **OTHER**: other types', example='SUB'),
      dnsGroup?: string(name='DnsGroup', description='The logical location type of the built-in authoritative module in which the zone is added. Valid values:

*   **NORMAL_ZONE**: regular module
*   **FAST_ZONE**: acceleration module', example='NORMAL_ZONE'),
      dnsGroupChanging?: boolean(name='DnsGroupChanging', description='Indicates whether the zone is being removed to another logical location. Valid values:

*   **true**
*   **false**', example='false'),
      isPtr?: boolean(name='IsPtr', description='Indicates whether the zone is a reverse lookup zone. Valid values:

*   **true**
*   **false**', example='true'),
      proxyPattern?: string(name='ProxyPattern', description='Indicates whether the recursive resolution proxy for subdomain names is enabled. Valid values:

*   **ZONE**: The recursive resolution proxy for subdomain names is disabled. In this case, NXDOMAIN is returned if the queried domain name does not exist in the zone.
*   **RECORD**: The recursive resolution proxy for subdomain names is enabled. In this case, if the queried domain name does not exist in the zone, DNS requests are recursively forwarded to the forward module and then to the recursion module until DNS results are returned.', example='ZONE'),
      recordCount?: int32(name='RecordCount', description='The number of Domain Name System (DNS) records added in the zone.', example='2'),
      remark?: string(name='Remark', description='The description of the zone.', example='test'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the zone belongs.', example='rg-aekz2qj7awz****'),
      resourceTags?: {
        resourceTag?: [ 
        {
          key?: string(name='Key', description='The key of tag N added to the zone.', example='env'),
          value?: string(name='Value', description='The value of tag N added to the zone.', example='daily'),
        }
      ](name='ResourceTag')
      }(name='ResourceTags', description='The tags added to the zone.'),
      updateTime?: string(name='UpdateTime', description='The time when the zone was last modified. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2018-01-03T08:57Z'),
      updateTimestamp?: long(name='UpdateTimestamp', description='The time when the DNS record was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since 00:00:00 UTC on January 1, 1970.', example='1514969843000'),
      zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.', example='6d83e3b31aa60ca4aaa7161f1b6b**95'),
      zoneName?: string(name='ZoneName', description='The name of the zone.', example='test.com'),
      zoneTag?: string(name='ZoneTag', description='The type of the cloud service. Valid values:

*   If ZoneType is set to AUTH_ZONE, no value is returned for this parameter.
*   If ZoneType is set to CLOUD_PRODUCT_ZONE, the type of the cloud service is returned.', example='BLINK'),
      zoneType?: string(name='ZoneType', description='The zone type. Valid values:

*   **AUTH_ZONE**: authoritative zone
*   **CLOUD_PRODUCT_ZONE**: authoritative zone for cloud services', example='CLOUD_PRODUCT_ZONE'),
    }
  ](name='Zone')
  }(name='Zones', description='The zones.'),
}

model DescribeZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeZonesResponseBody(name='body'),
}

/**
 * @summary Queries a list of zones within the current account.
 *
 * @param request DescribeZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeZonesResponse
 */
async function describeZonesWithOptions(request: DescribeZonesRequest, runtime: Util.RuntimeOptions): DescribeZonesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queryRegionId)) {
    query['QueryRegionId'] = request.queryRegionId;
  }
  if (!Util.isUnset(request.queryVpcId)) {
    query['QueryVpcId'] = request.queryVpcId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceTag)) {
    query['ResourceTag'] = request.resourceTag;
  }
  if (!Util.isUnset(request.searchMode)) {
    query['SearchMode'] = request.searchMode;
  }
  if (!Util.isUnset(request.zoneTag)) {
    query['ZoneTag'] = request.zoneTag;
  }
  if (!Util.isUnset(request.zoneType)) {
    query['ZoneType'] = request.zoneType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeZones',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of zones within the current account.
 *
 * @param request DescribeZonesRequest
 * @return DescribeZonesResponse
 */
async function describeZones(request: DescribeZonesRequest): DescribeZonesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeZonesWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='23423****'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs, which are zone IDs. You can specify up to 50 zone IDs.', example='97fe9321a476d0861f624d3f738dcc38'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid value: ZONE.

This parameter is required.', example='ZONE'),
  size?: int32(name='Size', description='The number of entries per page. Maximum value: 200. Default value: 20.', example='20'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag N added to the resource.', example='env'),
      value?: string(name='Value', description='The value of tag N added to the resource.', example='daily'),
    }
  ](name='Tag', description='The tags added to the resources.'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists.', example='23423****'),
  requestId?: string(name='RequestId', description='The request ID.', example='75446CC1-FC9A-4595-8D96-089D73D7A63D'),
  tagResources?: [ 
    {
      resourceId?: string(name='ResourceId', description='The resource ID, which is a zone ID.', example='97fe9321a476d0861f624d3f738d****'),
      resourceType?: string(name='ResourceType', description='The resource type.', example='ZONE'),
      tagKey?: string(name='TagKey', description='The key of tag N added to the resource.', example='env'),
      tagValue?: string(name='TagValue', description='The value of tag N added to the resource.', example='daily'),
    }
  ](name='TagResources', description='The tags added to the resources.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries a list of tags added to zones.
 *
 * @description #### [](#)**Precautions**
 * You can call this API operation to query tags added only to zones.
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of tags added to zones.
 *
 * @description #### [](#)**Precautions**
 * You can call this API operation to query tags added only to zones.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model MoveResourceGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='21079fa016944979537637959d09bc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the new resource group.

This parameter is required.', example='rg-aekz2qj7awz****'),
  resourceId?: string(name='ResourceId', description='The zone ID. This ID uniquely identifies the zone.

This parameter is required.', example='df2d03865266bd9842306db586d4****'),
}

model MoveResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D1324D48-1E23-4AEF-9EDE-466120561C6F'),
}

model MoveResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MoveResourceGroupResponseBody(name='body'),
}

/**
 * @summary Changes a resource group.
 *
 * @description #### [](#)Precautions
 * You can call this API operation to change a resource group only for a zone.
 *
 * @param request MoveResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MoveResourceGroupResponse
 */
async function moveResourceGroupWithOptions(request: MoveResourceGroupRequest, runtime: Util.RuntimeOptions): MoveResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MoveResourceGroup',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes a resource group.
 *
 * @description #### [](#)Precautions
 * You can call this API operation to change a resource group only for a zone.
 *
 * @param request MoveResourceGroupRequest
 * @return MoveResourceGroupResponse
 */
async function moveResourceGroup(request: MoveResourceGroupRequest): MoveResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return moveResourceGroupWithOptions(request, runtime);
}

model SearchCustomLinesRequest {
  createTimestampEnd?: long(name='CreateTimestampEnd', description='The end of the time range during which the custom lines are created to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1672136518234'),
  createTimestampStart?: long(name='CreateTimestampStart', description='The beginning of the time range during which the custom lines are created to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1672136518123'),
  creator?: [ string ](name='Creator', description='The IDs of the creators for the custom lines.'),
  ipv4?: string(name='Ipv4', description='The IPv4 address.', example='1.1.1.1'),
  lang?: string(name='Lang', description='The language.', example='zh'),
  name?: string(name='Name', description='The name of the custom line.'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page **1**. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **1 to 100**. Default value: **10**.', example='10'),
  updateTimestampEnd?: long(name='UpdateTimestampEnd', description='The end of the time range during which the custom lines are updated to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1672136518000'),
  updateTimestampStart?: long(name='UpdateTimestampStart', description='The beginning of the time range during which the custom lines are updated to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1672136515000'),
}

model SearchCustomLinesResponseBody = {
  customLines?: {
    customLine?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the custom line was created.', example='2022-12-27 18:16:38'),
      createTimestamp?: long(name='CreateTimestamp', description='The time when the custom line was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1671174074000'),
      creator?: string(name='Creator', description='The ID of the creator for the custom line.', example='1851321989648462'),
      creatorSubType?: string(name='CreatorSubType', description='The creator type. Valid values:

*   CUSTOM: Alibaba Cloud account
*   SUB: RAM user
*   STS: assumed role that obtains the Security Token Service (STS) token of a RAM role
*   OTHER: other types', example='SUB'),
      creatorType?: string(name='CreatorType', description='The role of the creator for the custom line. Valid values:

*   USER: user
*   SYSTEM: system', example='USER'),
      ipv4s?: {
        ipv4?: [ string ](name='Ipv4')
      }(name='Ipv4s', description='The IPv4 CIDR blocks.'),
      lineId?: string(name='LineId', description='The unique ID of the custom line.', example='11730'),
      name?: string(name='Name', description='The name of the custom line.'),
      updateTime?: string(name='UpdateTime', description='The time when the custom line was updated.', example='2023-06-14 14:04:08'),
      updateTimestamp?: long(name='UpdateTimestamp', description='The time when the custom line was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1672136518000'),
    }
  ](name='CustomLine')
  }(name='CustomLines', description='The custom lines.'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **1 to 100**. Default value: **10**.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='46973D4C-E3E4-4ABA-9190-9A9DE406C7E'),
  totalItems?: int32(name='TotalItems', description='The total number of entries returned.', example='100'),
  totalPages?: int32(name='TotalPages', description='The total number of returned pages.', example='5'),
}

model SearchCustomLinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchCustomLinesResponseBody(name='body'),
}

/**
 * @summary Queries a list of custom lines.
 *
 * @param request SearchCustomLinesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchCustomLinesResponse
 */
async function searchCustomLinesWithOptions(request: SearchCustomLinesRequest, runtime: Util.RuntimeOptions): SearchCustomLinesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.createTimestampEnd)) {
    query['CreateTimestampEnd'] = request.createTimestampEnd;
  }
  if (!Util.isUnset(request.createTimestampStart)) {
    query['CreateTimestampStart'] = request.createTimestampStart;
  }
  if (!Util.isUnset(request.creator)) {
    query['Creator'] = request.creator;
  }
  if (!Util.isUnset(request.ipv4)) {
    query['Ipv4'] = request.ipv4;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.updateTimestampEnd)) {
    query['UpdateTimestampEnd'] = request.updateTimestampEnd;
  }
  if (!Util.isUnset(request.updateTimestampStart)) {
    query['UpdateTimestampStart'] = request.updateTimestampStart;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SearchCustomLines',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of custom lines.
 *
 * @param request SearchCustomLinesRequest
 * @return SearchCustomLinesResponse
 */
async function searchCustomLines(request: SearchCustomLinesRequest): SearchCustomLinesResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchCustomLinesWithOptions(request, runtime);
}

model SetProxyPatternRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='21079fa016944979537637959d09bc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  proxyPattern?: string(name='ProxyPattern', description='Specifies whether to enable the recursive resolution proxy for subdomain names. Valid values:

*   **ZONE**: disables the recursive resolution proxy for subdomain names. In this case, NXDOMAIN is returned if the queried subdomain name does not exist in the zone.
*   **RECORD**: enables the recursive resolution proxy for subdomain names. In this case, if the queried domain name does not exist in the zone, Domain Name System (DNS) requests are recursively forwarded to the forward module and then to the recursion module until DNS results are returned.

This parameter is required.', example='ZONE'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='10.61.XX.XX'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.

This parameter is required.', example='df2d03865266bd9842306db586d3****'),
}

model SetProxyPatternResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='C6F1D541-E7A6-447A-A2B5-9F7A20B2A8FB'),
  zoneId?: string(name='ZoneId', description='The global ID of the zone.', example='df2d03865266bd9842306db586d3****'),
}

model SetProxyPatternResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetProxyPatternResponseBody(name='body'),
}

/**
 * @summary Enables the recursive resolution proxy for subdomain names.
 *
 * @param request SetProxyPatternRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetProxyPatternResponse
 */
async function setProxyPatternWithOptions(request: SetProxyPatternRequest, runtime: Util.RuntimeOptions): SetProxyPatternResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.proxyPattern)) {
    query['ProxyPattern'] = request.proxyPattern;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetProxyPattern',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables the recursive resolution proxy for subdomain names.
 *
 * @param request SetProxyPatternRequest
 * @return SetProxyPatternResponse
 */
async function setProxyPattern(request: SetProxyPatternRequest): SetProxyPatternResponse {
  var runtime = new Util.RuntimeOptions{};
  return setProxyPatternWithOptions(request, runtime);
}

model SetZoneRecordStatusRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='6447728c8578e66aacf062d2df4446dc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  recordId?: long(name='RecordId', description='The ID of the DNS record.

This parameter is required.', example='207541****'),
  status?: string(name='Status', description='The state of the DNS record. Valid values:

*   ENABLE: enables the DNS record.
*   DISABLE: suspends the DNS record.

This parameter is required.', example='DISABLE'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.XX.XX'),
}

model SetZoneRecordStatusResponseBody = {
  recordId?: long(name='RecordId', description='The ID of the DNS record.', example='207541****'),
  requestId?: string(name='RequestId', description='The request ID.', example='39CB16E5-4180-49F2-A060-23C0ECEB80D9'),
  status?: string(name='Status', description='The state of the DNS record. Valid values:

*   ENABLE: The DNS record is enabled.
*   DISABLE: The DNS record is disabled.', example='DISABLE'),
}

model SetZoneRecordStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetZoneRecordStatusResponseBody(name='body'),
}

/**
 * @summary Enables or disables a Domain Name System (DNS) record.
 *
 * @param request SetZoneRecordStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetZoneRecordStatusResponse
 */
async function setZoneRecordStatusWithOptions(request: SetZoneRecordStatusRequest, runtime: Util.RuntimeOptions): SetZoneRecordStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetZoneRecordStatus',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables or disables a Domain Name System (DNS) record.
 *
 * @param request SetZoneRecordStatusRequest
 * @return SetZoneRecordStatusResponse
 */
async function setZoneRecordStatus(request: SetZoneRecordStatusRequest): SetZoneRecordStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setZoneRecordStatusWithOptions(request, runtime);
}

model TagResourcesRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  overWrite?: boolean(name='OverWrite', description='Specifies whether to replace the original tags added to the resources. Valid values:

*   True: replaces the original tags.
*   False (default): appends the specified one or more tags to the original tags. If a new tag has the same key but a different value from an original tag, the new tag replaces the original tag.', example='true'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs, which are zone IDs. You can specify up to 50 zone IDs.

This parameter is required.', example='97fe9321a476d0861f624d3f738dcc38'),
  resourceType?: string(name='ResourceType', description='The resource type. Valid value: ZONE.

This parameter is required.', example='ZONE'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag N to add to the resources.', example='env'),
      value?: string(name='Value', description='The value of tag N to add to the resources.', example='daily'),
    }
  ](name='Tag', description='The tags to add to the resources.

This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='75446CC1-FC9A-4595-8D96-089D73D7A63D'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Adds or modifies tags for zones.
 *
 * @description ##### [](#)Precautions
 * You can configure tags only for zones.
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.overWrite)) {
    query['OverWrite'] = request.overWrite;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds or modifies tags for zones.
 *
 * @description ##### [](#)Precautions
 * You can configure tags only for zones.
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags of the specified zones. Valid values:

*   true: removes all tags of the specified zones.
*   false: removes only the tags with the specified tag keys.

Default value: false.', example='true'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  resourceId?: [ string ](name='ResourceId', description='The resource IDs, which are zone IDs. You can specify up to 50 zone IDs.

This parameter is required.', example='97fe9321a476d0861f624d3f738dcc38'),
  resourceType?: string(name='ResourceType', description='The resource type. The value of ResourceType can only be ZONE.

This parameter is required.', example='ZONE'),
  tagKey?: [ string ](name='TagKey', description='The keys of tags that you want to remove. You can specify up to 20 tag keys.', example='env'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='75446CC1-FC9A-4595-8D96-089D73D7A63D'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes the tags of multiple zones at a time.
 *
 * @description #### [](#)**Precautions**
 * You can call this API operation to remove tags added only to zones.
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes the tags of multiple zones at a time.
 *
 * @description #### [](#)**Precautions**
 * You can call this API operation to remove tags added only to zones.
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateCustomLineRequest {
  ipv4s?: [ string ](name='Ipv4s', description='The IPv4 CIDR blocks.

This parameter is required.'),
  lang?: string(name='Lang', description='The language.', example='en'),
  lineId?: string(name='LineId', description='The unique ID of the custom line.

This parameter is required.', example='100003'),
  name?: string(name='Name', description='The name of the custom line.'),
}

model UpdateCustomLineResponseBody = {
  lineId?: string(name='LineId', description='The unique ID of the custom line.', example='765001'),
  requestId?: string(name='RequestId', description='The request ID.', example='0B7AD377-7E86-44A8-B9A8-53E8666E72FE'),
}

model UpdateCustomLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCustomLineResponseBody(name='body'),
}

/**
 * @summary Modifies a custom line.
 *
 * @param request UpdateCustomLineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCustomLineResponse
 */
async function updateCustomLineWithOptions(request: UpdateCustomLineRequest, runtime: Util.RuntimeOptions): UpdateCustomLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipv4s)) {
    query['Ipv4s'] = request.ipv4s;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.lineId)) {
    query['LineId'] = request.lineId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCustomLine',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a custom line.
 *
 * @param request UpdateCustomLineRequest
 * @return UpdateCustomLineResponse
 */
async function updateCustomLine(request: UpdateCustomLineRequest): UpdateCustomLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCustomLineWithOptions(request, runtime);
}

model UpdateRecordRemarkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='6447728c8578e66aacf062d2df4446dc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  recordId?: long(name='RecordId', description='The ID of the DNS record.

This parameter is required.', example='202991****'),
  remark?: string(name='Remark', description='The description of the DNS record.', example='test record'),
}

model UpdateRecordRemarkResponseBody = {
  recordId?: long(name='RecordId', description='The ID of the DNS record.', example='202991****'),
  requestId?: string(name='RequestId', description='The request ID.', example='0B7AD377-7E86-44A8-B9A8-53E8666E72FE'),
}

model UpdateRecordRemarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRecordRemarkResponseBody(name='body'),
}

/**
 * @summary Modifies the description of a Domain Name System (DNS) record based on the record ID.
 *
 * @param request UpdateRecordRemarkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRecordRemarkResponse
 */
async function updateRecordRemarkWithOptions(request: UpdateRecordRemarkRequest, runtime: Util.RuntimeOptions): UpdateRecordRemarkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateRecordRemark',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the description of a Domain Name System (DNS) record based on the record ID.
 *
 * @param request UpdateRecordRemarkRequest
 * @return UpdateRecordRemarkResponse
 */
async function updateRecordRemark(request: UpdateRecordRemarkRequest): UpdateRecordRemarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateRecordRemarkWithOptions(request, runtime);
}

model UpdateResolverEndpointRequest {
  endpointId?: string(name='EndpointId', description='The endpoint ID.

This parameter is required.', example='hr****'),
  ipConfig?: [ 
    {
      azId?: string(name='AzId', description='The ID of the zone to which the vSwitch belongs.', example='cn-hangzhou-a'),
      cidrBlock?: string(name='CidrBlock', description='The IPv4 CIDR block of the vSwitch.', example='172.16.XX.XX/24'),
      ip?: string(name='Ip', description='The source IP address of outbound traffic. The IP address must be within the specified CIDR block. If you leave this parameter empty, the system automatically allocates an IP address.', example='172.16.XX.XX'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-0jlgeyq4oazkh5xue****'),
    }
  ](name='IpConfig', description='The source IP addresses of outbound traffic. You can add two to six IP addresses.

>  You must add at least two source IP addresses for outbound traffic to ensure high availability. We recommend that you add two IP addresses that reside in different zones. You can add up to six source IP addresses.'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  name?: string(name='Name', description='The endpoint name.', example='endpoint-test-name'),
}

model UpdateResolverEndpointResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EC0BDA3A-A92A-4AC8-B351-322A9C79D5C5'),
}

model UpdateResolverEndpointResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateResolverEndpointResponseBody(name='body'),
}

/**
 * @summary Modifies an endpoint.
 *
 * @param request UpdateResolverEndpointRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateResolverEndpointResponse
 */
async function updateResolverEndpointWithOptions(request: UpdateResolverEndpointRequest, runtime: Util.RuntimeOptions): UpdateResolverEndpointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.ipConfig)) {
    query['IpConfig'] = request.ipConfig;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateResolverEndpoint',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an endpoint.
 *
 * @param request UpdateResolverEndpointRequest
 * @return UpdateResolverEndpointResponse
 */
async function updateResolverEndpoint(request: UpdateResolverEndpointRequest): UpdateResolverEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateResolverEndpointWithOptions(request, runtime);
}

model UpdateResolverRuleRequest {
  endpointId?: string(name='EndpointId', description='The endpoint ID.', example='hr****'),
  forwardIp?: [ 
    {
      ip?: string(name='Ip', description='The IP address of the destination server.

>  You cannot specify the following IP addresses as the IP addresses of the external DNS servers because the IP addresses are reserved by the system: 100.100.2.136 to 100.100.2.138, and 100.100.2.116 to 100.100.2.118.', example='172.16.XX.XX'),
      port?: int32(name='Port', description='The port of the destination server.', example='8080'),
    }
  ](name='ForwardIp', description='The IP addresses and ports of the external Domain Name System (DNS) servers. Enter the IP addresses and ports of the destination servers to which the DNS requests are forwarded. You can enter up to six IP addresses and ports. Both private and public IP addresses are supported.

>  If you specify public IP addresses as the IP addresses of the external DNS servers and Elastic Compute Service (ECS) instances in the outbound virtual private cloud (VPC) are not assigned public IP addresses, you need to activate NAT Gateway for the VPC and create and manage SNAT entries on a NAT gateway.'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  name?: string(name='Name', description='The name of the forwarding rule.', example='forward rule-test'),
  ruleId?: string(name='RuleId', description='The ID of the forwarding rule.

This parameter is required.', example='hr****'),
}

model UpdateResolverRuleResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='0C9959BE-3A6A-4803-8DCE-973B42ACD599'),
}

model UpdateResolverRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateResolverRuleResponseBody(name='body'),
}

/**
 * @summary Modifies a forwarding rule.
 *
 * @param request UpdateResolverRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateResolverRuleResponse
 */
async function updateResolverRuleWithOptions(request: UpdateResolverRuleRequest, runtime: Util.RuntimeOptions): UpdateResolverRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endpointId)) {
    query['EndpointId'] = request.endpointId;
  }
  if (!Util.isUnset(request.forwardIp)) {
    query['ForwardIp'] = request.forwardIp;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateResolverRule',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a forwarding rule.
 *
 * @param request UpdateResolverRuleRequest
 * @return UpdateResolverRuleResponse
 */
async function updateResolverRule(request: UpdateResolverRuleRequest): UpdateResolverRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateResolverRuleWithOptions(request, runtime);
}

model UpdateSyncEcsHostTaskRequest {
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  region?: [ 
    {
      regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
      userId?: long(name='UserId', description='The user ID to which the region belongs. This parameter is used in cross-account synchronization scenarios.', example='141339776561****'),
    }
  ](name='Region', description='The regions to be synchronized.

This parameter is required.'),
  status?: string(name='Status', description='The state of the hostname synchronization task. Valid values:

*   ON: The task is started.
*   OFF: The task is ended.

This parameter is required.', example='ON'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.

This parameter is required.', example='df2d03865266bd9842306db586d3****'),
}

model UpdateSyncEcsHostTaskResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='test-FC9A-4595-8D96-089D73D7A63D'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model UpdateSyncEcsHostTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSyncEcsHostTaskResponseBody(name='body'),
}

/**
 * @summary Adds or updates a hostname synchronization task.
 *
 * @param request UpdateSyncEcsHostTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSyncEcsHostTaskResponse
 */
async function updateSyncEcsHostTaskWithOptions(request: UpdateSyncEcsHostTaskRequest, runtime: Util.RuntimeOptions): UpdateSyncEcsHostTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSyncEcsHostTask',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds or updates a hostname synchronization task.
 *
 * @param request UpdateSyncEcsHostTaskRequest
 * @return UpdateSyncEcsHostTaskResponse
 */
async function updateSyncEcsHostTask(request: UpdateSyncEcsHostTaskRequest): UpdateSyncEcsHostTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSyncEcsHostTaskWithOptions(request, runtime);
}

model UpdateZoneRecordRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='6447728c8578e66aacf062d2df4446dc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  line?: string(name='Line', description='The resolution line. Default value: default.', example='default'),
  priority?: int32(name='Priority', description='The priority of the MX record. You can set priorities for different email servers. Valid values: 1 to 99. A smaller value indicates a higher priority.

>  This parameter is required if the type of the DNS record is MX.', example='60'),
  recordId?: long(name='RecordId', description='The ID of the DNS record. You can call the DescribeZoneRecords operation to query a list of DNS records.

This parameter is required.', example='172223****'),
  rr?: string(name='Rr', description='The hostname. The hostname is the prefix of the subdomain name for zone. Example: www, @, \\\\* (used for wildcard DNS resolution), and mail (used for specifying the mail server that receives emails).

For example, if you want to resolve the domain name @.exmaple.com, you must set Rr to @ instead of leaving Rr empty.

This parameter is required.', example='www'),
  ttl?: int32(name='Ttl', description='The TTL period. Valid values: 5, 30, 60, 3600, 43200, and 86400. Unit: seconds.', example='60'),
  type?: string(name='Type', description='The type of the DNS record. Valid values:

*   **A**: An A record maps a domain name to an IPv4 address in the dotted decimal notation format.
*   **AAAA**: An AAAA record maps a domain name to an IPv6 address.
*   **CNAME**: A canonical name (CNAME) record maps a domain name to another domain name.
*   **TXT**: A text (TXT) record usually serves as a Sender Policy Framework (SPF) record to prevent email spam. The record value of the TXT record can be up to 255 characters in length.
*   **MX**: A mail exchanger (MX) record maps a domain name to the domain name of a mail server.
*   **PTR**: A pointer (PTR) record maps an IP address to a domain name.
*   **SRV**: A service (SRV) record specifies a server that hosts a specific service. Enter a record value in the format of Priority Weight Port Destination domain name. Separate these items with spaces.

>  Before you add a PTR record, you must configure a reverse lookup zone. For more information, see [Add PTR records](https://help.aliyun.com/document_detail/2592976.html).

This parameter is required.', example='A'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
  value?: string(name='Value', description='The record value. You need to enter the record value based on the DNS record type.

This parameter is required.', example='192.16.XX.XX'),
  weight?: int32(name='Weight', description='The weight value of the address. You can set a different weight value for each address. This way, addresses are returned based on the weight values for DNS requests. A weight value must be an integer that ranges from 1 to 100.', example='1'),
}

model UpdateZoneRecordResponseBody = {
  recordId?: long(name='RecordId', description='The ID of the DNS record.', example='172223****'),
  requestId?: string(name='RequestId', description='The request ID.', example='250E2C38-D0AD-4518-851D-1C1055805F82'),
}

model UpdateZoneRecordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateZoneRecordResponseBody(name='body'),
}

/**
 * @summary Modifies a Domain Name System (DNS) record of a zone, including the hostname, record value, and weight value of the DNS record.
 *
 * @description #### **Precautions**
 * The DNS record modification for a zone in the regular module takes effect only after the time to live (TTL) expires. The DNS record modification for a zone in the acceleration module takes effect immediately.
 *
 * @param request UpdateZoneRecordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateZoneRecordResponse
 */
async function updateZoneRecordWithOptions(request: UpdateZoneRecordRequest, runtime: Util.RuntimeOptions): UpdateZoneRecordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.line)) {
    query['Line'] = request.line;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.recordId)) {
    query['RecordId'] = request.recordId;
  }
  if (!Util.isUnset(request.rr)) {
    query['Rr'] = request.rr;
  }
  if (!Util.isUnset(request.ttl)) {
    query['Ttl'] = request.ttl;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  if (!Util.isUnset(request.weight)) {
    query['Weight'] = request.weight;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateZoneRecord',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a Domain Name System (DNS) record of a zone, including the hostname, record value, and weight value of the DNS record.
 *
 * @description #### **Precautions**
 * The DNS record modification for a zone in the regular module takes effect only after the time to live (TTL) expires. The DNS record modification for a zone in the acceleration module takes effect immediately.
 *
 * @param request UpdateZoneRecordRequest
 * @return UpdateZoneRecordResponse
 */
async function updateZoneRecord(request: UpdateZoneRecordRequest): UpdateZoneRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateZoneRecordWithOptions(request, runtime);
}

model UpdateZoneRemarkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='21079fa016944979537637959d09bc'),
  lang?: string(name='Lang', description='The language of the response. Valid values:

*   zh: Chinese
*   en: English

Default value: en.', example='en'),
  remark?: string(name='Remark', description='The new description. If you leave Remark empty, the zone has no description.', example='test'),
  userClientIp?: string(name='UserClientIp', description='The IP address of the client.', example='127.0.XX.XX'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.

This parameter is required.', example='df2d03865266bd9842306db586d3****'),
}

model UpdateZoneRemarkResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='C6F1D541-E7A6-447A-A2B5-9F7A20B2A8FB'),
  zoneId?: string(name='ZoneId', description='The zone ID. This ID uniquely identifies the zone.', example='df2d03865266bd9842306db586d3****'),
}

model UpdateZoneRemarkResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateZoneRemarkResponseBody(name='body'),
}

/**
 * @summary Modifies the description of a built-in authoritative zone.
 *
 * @param request UpdateZoneRemarkRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateZoneRemarkResponse
 */
async function updateZoneRemarkWithOptions(request: UpdateZoneRemarkRequest, runtime: Util.RuntimeOptions): UpdateZoneRemarkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!Util.isUnset(request.userClientIp)) {
    query['UserClientIp'] = request.userClientIp;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateZoneRemark',
    version = '2018-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the description of a built-in authoritative zone.
 *
 * @param request UpdateZoneRemarkRequest
 * @return UpdateZoneRemarkResponse
 */
async function updateZoneRemark(request: UpdateZoneRemarkRequest): UpdateZoneRemarkResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateZoneRemarkWithOptions(request, runtime);
}

